add resolved button for matched file

This commit is contained in:
smanylov
2026-03-27 13:50:41 +07:00
parent 6453e8402e
commit 9128c0e298
6 changed files with 158 additions and 95 deletions
+5 -2
View File
@@ -355,8 +355,11 @@ export async function fetchComplainInfo(id: number) {
}
}
export async function updateMatchStatus(id: number, status: string) {
export type MatchStatus = 'NEW' | 'SHOWED' | 'LEGAL_IN_WORK' | 'COMPLAINT_IN_WORK' | 'COMPLAINT_AND_LEGAL_IN_WORK' | 'AUTHORIZED_USE';
export async function updateMatchStatus(id: number, status: MatchStatus) {
const token = await getSessionData('token');
console.log('updateMatchStatus');
try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
@@ -380,7 +383,7 @@ export async function updateMatchStatus(id: number, status: string) {
if (response.ok) {
let parsed = await response.json();
if (parsed?.message_body.status === 'SHOWED') {
if (parsed?.message_body.status) {
return true
} else {
throw parsed;