From 9eae48ecd15c2b20e36d3f4c1d2fb74e1cff7379 Mon Sep 17 00:00:00 2001 From: anoop narang Date: Wed, 19 Aug 2020 21:01:55 +0530 Subject: [PATCH] [*] | Anoop | Fix response shown on hitting import api --- src/components/manifest/ImportManifestJson.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/manifest/ImportManifestJson.tsx b/src/components/manifest/ImportManifestJson.tsx index 3be411e..0e68793 100644 --- a/src/components/manifest/ImportManifestJson.tsx +++ b/src/components/manifest/ImportManifestJson.tsx @@ -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)) + } }) };