add appeal table

This commit is contained in:
smanylov
2026-05-27 14:20:00 +07:00
parent e4508cb788
commit d7521e6ad1
8 changed files with 802 additions and 6 deletions
+41
View File
@@ -105,4 +105,45 @@ export async function downloadFile(fileId: string, fileName: string) {
contentType: response.headers.get('content-type') || 'application/octet-stream',
fileName: fileName
}
}
export async function fetchAppealsContentList(page?: number, size?: number, sortBy?: string, sortDirection?: 'asc' | 'desc' | string) {
const token = await getSessionData('token');
try {
const response = await fetch(`${API_BASE_URL}/api/admin/info`, {
method: 'POST',
body: JSON.stringify({
version: 1,
msg_id: 40001,
message_body: {
action: 'all_appeals',
page: page,
page_size: size,
/* sort_by: sortDirection || 'asc',
sort_order: sortBy || '', */
}
}),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
}
});
if (response.ok) {
const parsed = await response.json();
if (parsed.message_code === 0) {
return parsed.message_body.message_body;
} else {
return null;
}
} else {
throw new Error(`${response.status}`);
}
} catch (error) {
return null;
}
}