diff --git a/src/components/Issuance/EmailIssuance.tsx b/src/components/Issuance/EmailIssuance.tsx index b9f9a479d..99a1acab0 100644 --- a/src/components/Issuance/EmailIssuance.tsx +++ b/src/components/Issuance/EmailIssuance.tsx @@ -119,7 +119,7 @@ const EmailIssuance = () => { transformedData.credentialDefinitionId = credentialSelected; const transformedJson = JSON.stringify(transformedData, null, 2); const response = await issueOobEmailCredential(transformedJson); - const { data } = response as AxiosResponse; + const { data } = response as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { if (data?.data) { @@ -134,9 +134,10 @@ const EmailIssuance = () => { setTimeout(() => { window.location.href = pathRoutes?.organizations?.issuedCredentials; }, 500); - } else { - setFailure(response as string); + } else { + setFailure(data?.message); setLoading(false); + setIssueLoader(false); setOpenModal(false); } } else {