Get card photo as blob in UI

This commit is contained in:
2020-11-15 04:36:41 +00:00
parent 67a019811b
commit 5ad6547028
2 changed files with 28 additions and 6 deletions
+11 -1
View File
@@ -70,7 +70,17 @@ export const requester = (route, method, token, data) => {
if (!response.ok) {
throw customError(response);
}
return method === 'DELETE' ? {} : response.json();
if (method === 'DELETE') {
return {};
}
const contentType = response.headers.get('content-type');
if (contentType && contentType.indexOf('application/json') !== -1) {
return response.json();
} else {
return response;
}
})
.catch(error => {
const code = error.data ? error.data.status : null;