Skip to content

Commit

Permalink
Remove unused async-await
Browse files Browse the repository at this point in the history
  • Loading branch information
timursevimli committed Feb 17, 2024
1 parent e37ca80 commit f1f1564
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ const customHeaders = ({ headers = {}, body }) => {
const httpApiCall = async (url, { method = 'POST', headers = {}, body }) => {
const custom = customHeaders({ headers, body });
const options = { method, headers: custom, body };
return await fetch(url, options).then(async (res) => {
return await fetch(url, options).then((res) => {
const code = res.status;
if (code === 200) return await res.json();
if (code === 200) return res.json();
const dest = `for ${method} ${url}`;
throw new Error(`HTTP status code ${code} ${dest}`);
});
Expand Down

0 comments on commit f1f1564

Please sign in to comment.