Skip to content

Commit

Permalink
await JSON response
Browse files Browse the repository at this point in the history
Method returns a promise, so you'll have to wait for the JSON
  • Loading branch information
xDreamLand authored Jul 15, 2021
1 parent a47feeb commit b425af5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/utils/fetchNui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function fetchNui<T = any>(eventName: string, data?: any): Promise<

const resp = await fetch(`https://${resourceName}/${eventName}`, options);

const respFormatted = resp.json()
const respFormatted = await resp.json()

return respFormatted
}
}

0 comments on commit b425af5

Please sign in to comment.