diff --git a/src/pages/BandoApplication/index.js b/src/pages/BandoApplication/index.js index 0e5846d..f46dcf4 100644 --- a/src/pages/BandoApplication/index.js +++ b/src/pages/BandoApplication/index.js @@ -165,19 +165,32 @@ const BandoApplication = () => { const validateApplicationCallback = (data) => { if (data.status === 'SUCCESS') { if (data.data.status) { - setApplicationStatus(data.data.status); // ask why not 'applicationStatus'? + setApplicationStatus(data.data.status); } } storeSet.main.unsetAsyncRequest(); } const errValidateApplicationCallback = (data) => { - if (toast.current) { - toast.current.show({ - severity: 'error', - summary: '', - detail: data.message - }); + if (data.status === 'VALIDATION_ERROR') { + if (formMsgs.current) { + formMsgs.current.show([ + { + id: '99', + sticky: true, severity: 'error', summary: '', + detail: data.data.join(' '), + closable: true + } + ]); + } + } else { + if (toast.current) { + toast.current.show({ + severity: 'error', + summary: '', + detail: data.message + }); + } } storeSet.main.unsetAsyncRequest(); } @@ -260,7 +273,7 @@ const BandoApplication = () => { { id: '99', sticky: true, severity: 'error', summary: '', - detail: data.data.join(', '), + detail: data.data.join(' '), closable: true } ]); @@ -420,7 +433,9 @@ const BandoApplication = () => { icon="pi pi-arrow-right" iconPos="right"/> : null}