add resolved button for matched file
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user