Skip to content

Commit

Permalink
more work on setting up seasons/training plans
Browse files Browse the repository at this point in the history
  • Loading branch information
rustybrooks committed Oct 10, 2024
1 parent 84a7971 commit fa25778
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ui/src/views/TrainingPlansManage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { DateInput } from '@mantine/dates';
import { DateTime } from 'luxon';
import { apiFetch, apiUrl } from '../api/api-fetch';

const fetchPreview = async (annual_hours: string, season_start_date: Date, season_end_date: Date) => {
const fetchPreview = async (annual_hours: string, season_start_date: Date | null, season_end_date: Date | null) => {
const body = JSON.stringify({
annual_hours: Number(annual_hours),
season_start_date: DateTime.fromJSDate(season_start_date).toISODate(),
season_end_date: DateTime.fromJSDate(season_end_date).toISODate(),
season_start_date: season_start_date ? DateTime.fromJSDate(season_start_date).toISODate() : null,
season_end_date: season_end_date ? DateTime.fromJSDate(season_end_date).toISODate() : null,
});

apiFetch(apiUrl('SEASONS_CTB_PREVIEW')(), {
Expand Down

0 comments on commit fa25778

Please sign in to comment.