clean ui
This commit is contained in:
@@ -502,6 +502,38 @@ export const apiFetchAppPool = async (q = '', limit = 50): Promise<{ data: AppPo
|
||||
return res.json();
|
||||
};
|
||||
|
||||
export interface AppTemplateItem {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
keywords: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export const apiAppTemplates = {
|
||||
list: async (): Promise<{ data: AppTemplateItem[] }> => {
|
||||
const res = await staffFetch('/app-templates');
|
||||
if (!res.ok) throw new Error('Không tải được khung ứng dụng');
|
||||
return res.json();
|
||||
},
|
||||
create: async (body: { name: string; description?: string; keywords: string }) => {
|
||||
const res = await staffFetch('/app-templates', { method: 'POST', body: JSON.stringify(body) });
|
||||
if (!res.ok) await parseError(res, 'Không tạo được khung');
|
||||
return res.json();
|
||||
},
|
||||
update: async (id: number, body: { name?: string; description?: string; keywords?: string }) => {
|
||||
const res = await staffFetch(`/app-templates/${id}`, { method: 'PATCH', body: JSON.stringify(body) });
|
||||
if (!res.ok) await parseError(res, 'Không cập nhật được khung');
|
||||
return res.json();
|
||||
},
|
||||
delete: async (id: number) => {
|
||||
const res = await staffFetch(`/app-templates/${id}`, { method: 'DELETE' });
|
||||
if (!res.ok) await parseError(res, 'Không xóa được khung');
|
||||
return res.json();
|
||||
},
|
||||
};
|
||||
|
||||
export interface WifiPoolItem {
|
||||
id: number;
|
||||
ssid: string;
|
||||
|
||||
Reference in New Issue
Block a user