This commit is contained in:
@@ -1216,21 +1216,36 @@ export const apiMyClasses = {
|
||||
};
|
||||
|
||||
export const apiSeatingLayout = {
|
||||
get: async (classRkId: number): Promise<string | null> => {
|
||||
getClass: async (classRkId: number): Promise<string | null> => {
|
||||
const res = await staffFetch(`/classes/${classRkId}/seating-layout`);
|
||||
if (!res.ok) return null;
|
||||
const json = await res.json() as { layoutJson: string | null };
|
||||
return json.layoutJson ?? null;
|
||||
},
|
||||
save: async (classRkId: number, layoutJson: string): Promise<void> => {
|
||||
saveClass: async (classRkId: number, layoutJson: string): Promise<void> => {
|
||||
await staffFetch(`/classes/${classRkId}/seating-layout`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ layoutJson }),
|
||||
});
|
||||
},
|
||||
delete: async (classRkId: number): Promise<void> => {
|
||||
deleteClass: async (classRkId: number): Promise<void> => {
|
||||
await staffFetch(`/classes/${classRkId}/seating-layout`, { method: 'DELETE' });
|
||||
},
|
||||
getExam: async (examRoomId: number): Promise<string | null> => {
|
||||
const res = await staffFetch(`/exam-rooms/${examRoomId}/seating-layout`);
|
||||
if (!res.ok) return null;
|
||||
const json = await res.json() as { layoutJson: string | null };
|
||||
return json.layoutJson ?? null;
|
||||
},
|
||||
saveExam: async (examRoomId: number, layoutJson: string): Promise<void> => {
|
||||
await staffFetch(`/exam-rooms/${examRoomId}/seating-layout`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ layoutJson }),
|
||||
});
|
||||
},
|
||||
deleteExam: async (examRoomId: number): Promise<void> => {
|
||||
await staffFetch(`/exam-rooms/${examRoomId}/seating-layout`, { method: 'DELETE' });
|
||||
},
|
||||
};
|
||||
|
||||
export const apiQldt = {
|
||||
|
||||
Reference in New Issue
Block a user