Implement access controlled edit schedule endpoint
Add PATCH /api/schedule endpoint for editing the schedule in a manner that's access controlled.
This commit is contained in:
parent
bb306ee938
commit
5255ed698e
3 changed files with 121 additions and 0 deletions
12
shared/types/schedule.d.ts
vendored
12
shared/types/schedule.d.ts
vendored
|
@ -49,3 +49,15 @@ export interface Schedule {
|
|||
roles?: Role[],
|
||||
rota?: Shift[],
|
||||
}
|
||||
|
||||
export type ChangeRecord<T extends { id: string }> =
|
||||
| { op: "set", data: T }
|
||||
| { op: "del", data: { id: string }}
|
||||
;
|
||||
|
||||
export interface SchedulePatch {
|
||||
locations?: ChangeRecord<ScheduleLocation>[],
|
||||
events?: ChangeRecord<ScheduleEvent>[],
|
||||
roles?: ChangeRecord<Role>[],
|
||||
rota?: ChangeRecord<Shift>[],
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue