fix(schedule): removed unused is_default from schedule_presets models

This commit is contained in:
Matthieu Haineault 2025-12-19 13:16:39 -05:00
parent 7c2b345600
commit b7956ce51b
2 changed files with 3 additions and 8 deletions

View File

@ -49,7 +49,6 @@ export const useEmployeeListApi = () => {
const backend_preset = new SchedulePreset(
preset.id,
preset.name,
preset.is_default,
preset_shifts
);

View File

@ -9,13 +9,11 @@ export type PresetManagerMode = 'create' | 'update' | 'copy' | 'delete';
export class SchedulePreset {
id: number;
name: string;
is_default: boolean;
shifts: SchedulePresetShift[];
constructor(id?: number, name?: string, is_default?: boolean, shifts?: SchedulePresetShift[]) {
constructor(id?: number, name?: string, shifts?: SchedulePresetShift[]) {
this.id = id ?? -1;
this.name = name ?? 'default';
this.is_default = is_default ?? false;
this.shifts = shifts ?? [];
}
}
@ -41,13 +39,11 @@ export class SchedulePresetShift {
export class SchedulePresetFrontend {
id: number;
name: string;
is_default: boolean;
weekdays: WeekdayPresetShifts[];
constructor(schedule_preset?: SchedulePreset) {
this.id = schedule_preset?.id ?? -1;
this.name = schedule_preset?.name ?? '';
this.is_default = schedule_preset?.is_default ?? false;
this.weekdays = WEEKDAYS.map(day => ({
day,
is_error: false,