feat: course color generation (#179)
* feat: course color generation * feat: add proper TS for hex colors * refactor: fix oklab and improve contrast ratios * fix: update HexColor type * refactor: update color switch point * refactor: color-related functions and types * fix: imports and TS issues * fix: imports and TS issues * chore: add no-restricted-syntax ForInStatement * chore(docs): add jsdoc --------- Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>
This commit is contained in:
@@ -14,10 +14,10 @@ export default async function deleteSchedule(scheduleId: string): Promise<string
|
||||
|
||||
const scheduleIndex = schedules.findIndex(schedule => schedule.id === scheduleId);
|
||||
if (scheduleIndex === -1) {
|
||||
return `Schedule ${scheduleId} does not exist`;
|
||||
throw new Error(`Schedule ${scheduleId} does not exist`);
|
||||
}
|
||||
if (scheduleIndex === activeIndex) {
|
||||
return 'Cannot delete active schedule';
|
||||
throw new Error('Cannot delete active schedule');
|
||||
}
|
||||
|
||||
schedules.splice(scheduleIndex, 1);
|
||||
|
||||
Reference in New Issue
Block a user