Skip to content

Commit

Permalink
feat(cb2-14394): repair json call to response body
Browse files Browse the repository at this point in the history
  • Loading branch information
naathanbrown committed Nov 25, 2024
1 parent e0e3525 commit 451aafb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/util/recalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ export const getMotRecallsByVin = async (vin: string, cache: Map<string, string>
},
});

let parsedRecallResponse = await recallResponse.json()

Check failure on line 43 in src/util/recalls.ts

View workflow job for this annotation

GitHub Actions / tests

Unsafe assignment of an `any` value

Check failure on line 43 in src/util/recalls.ts

View workflow job for this annotation

GitHub Actions / tests

Missing semicolon

logger.debug(`first recall status code: ${recallResponse.status}`);
logger.debug(`first recall response: ${JSON.stringify(await recallResponse.json())}`);
logger.debug(`first recall response: ${JSON.stringify(parsedRecallResponse)}`);

if (recallResponse.status === 403 || recallResponse.status === 401) {
const newBearerToken = await getBearerToken(motSecret);
Expand All @@ -57,13 +59,15 @@ export const getMotRecallsByVin = async (vin: string, cache: Map<string, string>
'x-api-key': motSecret.apiKey,
},
});

parsedRecallResponse = await recallResponse.json()

Check failure on line 63 in src/util/recalls.ts

View workflow job for this annotation

GitHub Actions / tests

Unsafe assignment of an `any` value

Check failure on line 63 in src/util/recalls.ts

View workflow job for this annotation

GitHub Actions / tests

Missing semicolon

Check failure on line 64 in src/util/recalls.ts

View workflow job for this annotation

GitHub Actions / tests

Trailing spaces not allowed
logger.debug(`second recall status code: ${recallResponse.status}`);
logger.debug(`second recall response: ${JSON.stringify(await recallResponse.json())}`);
logger.debug(`second recall response: ${JSON.stringify(parsedRecallResponse)}`);
}

if (recallResponse.status === 200) {
return await recallResponse.json() as MotRecalls;
return parsedRecallResponse as MotRecalls;
}

return undefined;
Expand Down

0 comments on commit 451aafb

Please sign in to comment.