fix send appeals
This commit is contained in:
@@ -191,7 +191,7 @@ export async function FileAnAppeal(fileId: string, appealReason: string, additio
|
|||||||
let parsed = await response.json();
|
let parsed = await response.json();
|
||||||
|
|
||||||
if (parsed.message_code === 0) {
|
if (parsed.message_code === 0) {
|
||||||
return parsed.message_body;
|
return parsed;
|
||||||
} else {
|
} else {
|
||||||
throw parsed;
|
throw parsed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -709,6 +709,7 @@ export default function TanstakFilesTable({ fileType, showFileLink }: { fileType
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleAppeal = async (file: FileItem) => {
|
const handleAppeal = async (file: FileItem) => {
|
||||||
|
console.log(file);
|
||||||
|
|
||||||
setOpenWindowChildren(() => {
|
setOpenWindowChildren(() => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -29,11 +29,14 @@ export function FileAppealModalWindow({ fileId, setWindowClose, setWindowChildre
|
|||||||
try {
|
try {
|
||||||
const result = await FileAnAppeal(fileId, appealReason, additionalInfo);
|
const result = await FileAnAppeal(fileId, appealReason, additionalInfo);
|
||||||
|
|
||||||
if (result && result.status === 'success') {
|
if (result?.message_desc === 'Appeal submitted successfully') {
|
||||||
toast.success(t('appeal-submitted-successfully'));
|
toast.success(t('appeal-submitted-successfully'));
|
||||||
setWindowClose(false);
|
setWindowClose(false);
|
||||||
} else {
|
} else if (result?.message_desc === 'Active appeal already exists for this file') {
|
||||||
toast.error(result?.message || t('appeal-submission-failed'));
|
toast.error(t('active-appeal-already-exists-for-this-file'));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
toast.error(result?.message_desc || t('appeal-submission-failed'));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Appeal submission error:', error);
|
console.error('Appeal submission error:', error);
|
||||||
|
|||||||
@@ -492,7 +492,8 @@
|
|||||||
"additional-info": "Additional information",
|
"additional-info": "Additional information",
|
||||||
"enter-additional-info": "Any additional information that may help...",
|
"enter-additional-info": "Any additional information that may help...",
|
||||||
"submit-appeal": "Submit appeal",
|
"submit-appeal": "Submit appeal",
|
||||||
"submitting": "Submitting..."
|
"submitting": "Submitting...",
|
||||||
|
"active-appeal-already-exists-for-this-file": "Active appeal already exists for this file"
|
||||||
},
|
},
|
||||||
"Login-register-form": {
|
"Login-register-form": {
|
||||||
"and": "and",
|
"and": "and",
|
||||||
|
|||||||
@@ -492,7 +492,8 @@
|
|||||||
"additional-info": "Дополнительная информация",
|
"additional-info": "Дополнительная информация",
|
||||||
"enter-additional-info": "Любая дополнительная информация, которая может помочь...",
|
"enter-additional-info": "Любая дополнительная информация, которая может помочь...",
|
||||||
"submit-appeal": "Отправить апелляцию",
|
"submit-appeal": "Отправить апелляцию",
|
||||||
"submitting": "Отправка..."
|
"submitting": "Отправка...",
|
||||||
|
"active-appeal-already-exists-for-this-file": "По данному делу уже подана активная апелляция"
|
||||||
},
|
},
|
||||||
"Login-register-form": {
|
"Login-register-form": {
|
||||||
"and": "и",
|
"and": "и",
|
||||||
|
|||||||
Reference in New Issue
Block a user