fix
All checks were successful
Deploy on Master Change / deploy (push) Successful in 1m17s

This commit is contained in:
2026-07-13 11:00:17 +07:00
parent 06f2edb195
commit bad51585db
7 changed files with 125 additions and 47 deletions

View File

@@ -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 = {