Skip to content

Commit

Permalink
schema errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
DereC4 committed Mar 14, 2024
1 parent 7e2bc61 commit 5a7280d
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/pages/background/lib/createSchedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default async function createSchedule(scheduleName: string): Promise<stri
courses: [],
hours: 0,
updatedAt: Date.now(),
id: '',
});

await UserScheduleStore.set('schedules', schedules);
Expand Down
1 change: 1 addition & 0 deletions src/shared/storage/UserScheduleStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const UserScheduleStore = createLocalStore<IUserScheduleStore>({
name: 'Schedule 1',
hours: 0,
updatedAt: Date.now(),
id: '',
}),
],
activeIndex: 0,
Expand Down
2 changes: 2 additions & 0 deletions src/stories/components/calendar/CalendarSchedules.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const schedules = [
name: 'Main Schedule',
hours: 0,
updatedAt: Date.now(),
id: '',
}),
new UserSchedule({
courses: [
Expand Down Expand Up @@ -138,6 +139,7 @@ const schedules = [
name: 'Backup #3',
hours: 0,
updatedAt: Date.now(),
id: '',
}),
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const ClosedCourse: Story = {
...MikeScottCS314Course,
status: Status.CLOSED,
} as Course,
activeSchedule: new UserSchedule({ courses: [], name: '', hours: 0, updatedAt: Date.now() }),
activeSchedule: new UserSchedule({ courses: [], name: '', hours: 0, updatedAt: Date.now(), id: '' }),
},
};

Expand Down
3 changes: 3 additions & 0 deletions src/stories/injected/mocked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const exampleSchedule: UserSchedule = new UserSchedule({
name: 'Example Schedule',
hours: 3,
updatedAt: Date.now(),
id: '',
});

export const bevoCourse: Course = new Course({
Expand Down Expand Up @@ -110,6 +111,7 @@ export const bevoScheule: UserSchedule = new UserSchedule({
name: 'Bevo Schedule',
hours: 3,
updatedAt: Date.now(),
id: '',
});

export const MikeScottCS314Course: Course = new Course({
Expand Down Expand Up @@ -163,4 +165,5 @@ export const MikeScottCS314Schedule: UserSchedule = new UserSchedule({
name: 'Mike Scott CS314 Schedule',
hours: 3,
updatedAt: Date.now(),
id: '',
});
1 change: 1 addition & 0 deletions src/views/hooks/useFlattenedCourseSchedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export function useFlattenedCourseSchedule(): FlattenedCourseSchedule {
name: 'Something may have went wrong',
hours: 0,
updatedAt: Date.now(),
id: '',
}),
} satisfies FlattenedCourseSchedule;
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/hooks/useSchedules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function useSchedules(): [active: UserSchedule, schedules: UserSc
export function getActiveSchedule(): UserSchedule {
return (
schedulesCache[activeIndexCache] ||
new UserSchedule({ courses: [], name: 'An error has occurred', hours: 0, updatedAt: Date.now() })
new UserSchedule({ courses: [], name: 'An error has occurred', hours: 0, updatedAt: Date.now(), id: '' })
);
}

Expand Down

0 comments on commit 5a7280d

Please sign in to comment.