[*] | Anoop | Fix response shown on hitting import api

This commit is contained in:
anoop narang
2020-08-19 21:01:55 +05:30
parent 9918efb54b
commit 9eae48ecd1

View File

@@ -30,8 +30,13 @@ const ImportManifestJson = (props: any) => {
method: "POST",
body: JSON.stringify(importRequest),
}).then(res => {
res.ok ? setImportResSeverity('info') : setImportResSeverity('error')
res.json().then(resJson => setImportResponse(resJson))
if(res.ok) {
setImportResSeverity('success')
setImportResponse('Imported')
} else {
setImportResSeverity('error')
res.json().then(resJson => setImportResponse(resJson))
}
})
};