add final summary block

This commit is contained in:
smanylov
2026-04-28 13:08:35 +07:00
parent 2cada9ba27
commit d24884f7e6
6 changed files with 81 additions and 22 deletions
+36
View File
@@ -262,6 +262,42 @@ export async function fetchViolationStatistic() {
}
}
export async function fetchViolationFinalSummaryStatistic() {
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: 30023,
message_body: {
token: token,
}
}),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
});
if (response.ok) {
let parsed = await response.json();
console.log(parsed);
if (parsed?.message_code === 0) {
return parsed?.message_body;
} else {
throw null;
}
} else {
throw (`${response.status}`);
}
} catch (error) {
return null
}
}
interface complainBody {
previousText: string,
violationID: string | null,