This commit is contained in:
@@ -965,3 +965,20 @@ export const apiExam = {
|
||||
}>;
|
||||
},
|
||||
};
|
||||
|
||||
export const apiQldt = {
|
||||
getToken: async (): Promise<{ token: string }> => {
|
||||
const res = await staffFetch('/qldt-token');
|
||||
if (!res.ok) await parseError(res, 'Không tải được token QLĐT');
|
||||
return res.json();
|
||||
},
|
||||
saveToken: async (token: string): Promise<{ ok: boolean; message: string }> => {
|
||||
const res = await staffFetch('/qldt-token', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ token }),
|
||||
});
|
||||
if (!res.ok) await parseError(res, 'Lưu token thất bại');
|
||||
return res.json();
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user