Skip to content

Commit a5d4d58

Browse files
committed
refactor(client): update TrainingForm default values format
Replaced `startDateTime` and `endDateTime` defaults with `undefined` in the TrainingForm component. Adjusted type definitions by introducing `TrainingFormValues` for better alignment with optional fields.
1 parent cdbaf9d commit a5d4d58

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

client/src/components/Admin/OrgAdmin/Training/TrainingForm.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@ const inputClass = cn(
2020
removeFocusOutlines,
2121
);
2222

23-
const defaultTrainingFormValues: TrainingCreateParams = {
23+
type TrainingFormValues = Omit<TrainingCreateParams, 'startDateTime' | 'endDateTime'> & {
24+
startDateTime?: Date | undefined;
25+
endDateTime?: Date | undefined;
26+
};
27+
28+
const defaultTrainingFormValues: TrainingFormValues = {
2429
name: 'Accelerate your Testing Processes with GenAI',
2530
description: '',
2631
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, // Default to browser timezone
27-
startDateTime: new Date(),
28-
endDateTime: new Date(Date.now() + 3600000), // Default to 1 hour from now
32+
startDateTime: undefined,
33+
endDateTime: undefined,
2934
participantCount: 1,
3035
trainers: [],
3136
trainees: [],

0 commit comments

Comments
 (0)