fix: return when success status 204 (#5562)

* fix: return when success status 204

* fix: handle login in handleZoomResponse

* Add response.status check after the response.ok check

Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
Udit TakkarandAlex van Andel authored and GitHub committed 2022-11-17 21:27:22 +00:00
1 parent 3889b49fa1
commit c728174c14
1 file changed
+4 -1
@@ -339,7 +339,10 @@ const handleZoomResponse = async (response: Response, credentialId: Credential["
}
throw Error(response.statusText);
}
// handle 204 response code with empty response (causes crash otherwise as "" is invalid JSON)
if (response.status === 204) {
return;
}
return responseClone.json();
};