Skip to content

Commit

Permalink
remove double await
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshshanmugam committed Oct 13, 2023
1 parent 43741c0 commit b73c8c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/push/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export async function sendReqAndHandleError<T>(
options: APIRequestOptions
): Promise<T> {
const { statusCode, body } = await sendRequest(options);
return (await (await handleError(statusCode, options.url, body)).json()) as T;
return (
await handleError(statusCode, options.url, body)
).json() as Promise<T>;
}

type APIError = {
Expand Down

0 comments on commit b73c8c7

Please sign in to comment.