Skip to content

Commit

Permalink
✨ Håndterer 204 respons
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrognes committed May 21, 2024
1 parent 4143aee commit b54cc70
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/utils/api/simpleTokenXProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ export const simpleTokenXProxy = async <T>({

if (response.ok) {
logInfo(`OK ${url}, status ${response.status}, callId ${navCallId}`);

if (response.status === 204) {
return 'request gikk fint' as T;
}

const headers = response.headers.get('content-type');
const isJson = headers?.includes('application/json');

Expand Down

0 comments on commit b54cc70

Please sign in to comment.