refactor(UserSchedule): index by a unique id rather than name (#166)

* refactor(UserSchedule): index by a unique id rather than name

* refactor: Update parameter names in schedule function jsdocs

* refactor: change more instances of .name to .id

* refactor: Fix typo in variable name and update references

* refactor: Remove console.log statement

* fix(chromatic): Update ScheduleListItem story

* refactor: remove unused eslint rule
This commit is contained in:
Razboy20
2024-03-14 23:09:04 -05:00
committed by GitHub
parent 5714ed16d7
commit 85769e9d2c
31 changed files with 182 additions and 304 deletions

View File

@@ -6,25 +6,25 @@ import type { Course } from '@shared/types/Course';
export interface UserScheduleMessages {
/**
* Add a course to a schedule
* @param data the schedule name and course to add
* @param data the schedule id and course to add
*/
addCourse: (data: { scheduleName: string; course: Course }) => void;
addCourse: (data: { scheduleId: string; course: Course }) => void;
/**
* Remove a course from a schedule
* @param data the schedule name and course to remove
* @param data the schedule id and course to remove
*/
removeCourse: (data: { scheduleName: string; course: Course }) => void;
removeCourse: (data: { scheduleId: string; course: Course }) => void;
/**
* Clears all courses from a schedule
* @param data the name of the schedule to clear
* @param data the id of the schedule to clear
*/
clearCourses: (data: { scheduleName: string }) => void;
clearCourses: (data: { scheduleId: string }) => void;
/**
* Switches the active schedule to the one specified
* @param data the name of the schedule to switch to
* @param data the id of the schedule to switch to
*/
switchSchedule: (data: { scheduleName: string }) => void;
switchSchedule: (data: { scheduleId: string }) => void;
/**
* Creates a new schedule with the specified name
@@ -34,14 +34,14 @@ export interface UserScheduleMessages {
createSchedule: (data: { scheduleName: string }) => string | undefined;
/**
* Deletes a schedule with the specified name
* @param data the name of the schedule to delete
* @param data the id of the schedule to delete
* @returns undefined if successful, otherwise an error message
*/
deleteSchedule: (data: { scheduleName: string }) => string | undefined;
deleteSchedule: (data: { scheduleId: string }) => string | undefined;
/**
* Renames a schedule with the specified name
* @param data the name of the schedule to rename and the new name
* @param data the id of the schedule to rename and the new name
* @returns undefined if successful, otherwise an error message
*/
renameSchedule: (data: { scheduleName: string; newName: string }) => string | undefined;
renameSchedule: (data: { scheduleId: string; newName: string }) => string | undefined;
}