diff --git a/src/pages/BandoApplication/index.js b/src/pages/BandoApplication/index.js index 4204e44..4067d02 100644 --- a/src/pages/BandoApplication/index.js +++ b/src/pages/BandoApplication/index.js @@ -174,19 +174,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(); } @@ -269,7 +282,7 @@ const BandoApplication = () => { { id: '99', sticky: true, severity: 'error', summary: '', - detail: data.data.join(', '), + detail: data.data.join(' '), closable: true } ]); @@ -441,7 +454,9 @@ const BandoApplication = () => { icon="pi pi-arrow-right" iconPos="right"/> : null}