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

This commit is contained in:
2026-07-13 11:21:58 +07:00
parent 120ff1f3c8
commit 24a4ef2c66
2 changed files with 84 additions and 24 deletions

View File

@@ -1223,13 +1223,15 @@ export const apiSeatingLayout = {
return json.layoutJson ?? null;
},
saveClass: async (classRkId: number, layoutJson: string): Promise<void> => {
await staffFetch(`/classes/${classRkId}/seating-layout`, {
const res = await staffFetch(`/classes/${classRkId}/seating-layout`, {
method: 'PUT',
body: JSON.stringify({ layoutJson }),
});
if (!res.ok) await parseError(res, 'Lưu sơ đồ lớp thất bại');
},
deleteClass: async (classRkId: number): Promise<void> => {
await staffFetch(`/classes/${classRkId}/seating-layout`, { method: 'DELETE' });
const res = await staffFetch(`/classes/${classRkId}/seating-layout`, { method: 'DELETE' });
if (!res.ok) await parseError(res, 'Xóa sơ đồ lớp thất bại');
},
getExam: async (examRoomId: number): Promise<string | null> => {
const res = await staffFetch(`/exam-rooms/${examRoomId}/seating-layout`);
@@ -1238,13 +1240,15 @@ export const apiSeatingLayout = {
return json.layoutJson ?? null;
},
saveExam: async (examRoomId: number, layoutJson: string): Promise<void> => {
await staffFetch(`/exam-rooms/${examRoomId}/seating-layout`, {
const res = await staffFetch(`/exam-rooms/${examRoomId}/seating-layout`, {
method: 'PUT',
body: JSON.stringify({ layoutJson }),
});
if (!res.ok) await parseError(res, 'Lưu sơ đồ phòng thi thất bại');
},
deleteExam: async (examRoomId: number): Promise<void> => {
await staffFetch(`/exam-rooms/${examRoomId}/seating-layout`, { method: 'DELETE' });
const res = await staffFetch(`/exam-rooms/${examRoomId}/seating-layout`, { method: 'DELETE' });
if (!res.ok) await parseError(res, 'Xóa sơ đồ phòng thi thất bại');
},
};