add TrackingHistoryView

This commit is contained in:
smanylov
2026-05-06 19:03:29 +07:00
parent af6b997ceb
commit 8a72dbaf68
6 changed files with 496 additions and 39 deletions
+38
View File
@@ -158,6 +158,44 @@ export async function filePermisionChange(fileId: string, permissions: boolean)
return false;
}
} else {
throw new Error(`${response.status}`);
}
} catch (error) {
return null;
}
}
export async function fetchHistoryView(page: number, size: number) {
const token = await getSessionData('token');
try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
method: 'POST',
body: JSON.stringify({
version: 1,
msg_id: 30028,
message_body: {
token: token,
action: 'history_view',
page: page,
size: size
}
}),
headers: {
'Content-Type': 'application/json'
}
});
if (response.ok) {
const parsed = await response.json();
if (parsed.message_code === 0) {
return parsed.message_body;
} else {
return null;
}
} else {
throw new Error(`${response.status}`);
}