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 <me@alexvanandel.com>
pull/5501/head^2
Udit Takkar 2022-11-18 02:57:22 +05:30 committed by GitHub
parent 3889b49fa1
commit c728174c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -339,7 +339,10 @@ const handleZoomResponse = async (response: Response, credentialId: Credential["
} }
throw Error(response.statusText); 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(); return responseClone.json();
}; };