From b425af58788af5c38ef1f964b5459350399bfda5 Mon Sep 17 00:00:00 2001 From: xDreamLand <45896839+xDreamLand@users.noreply.github.com> Date: Thu, 15 Jul 2021 21:48:08 +0200 Subject: [PATCH] await JSON response Method returns a promise, so you'll have to wait for the JSON --- web/src/utils/fetchNui.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/utils/fetchNui.ts b/web/src/utils/fetchNui.ts index a0ee068..6069465 100644 --- a/web/src/utils/fetchNui.ts +++ b/web/src/utils/fetchNui.ts @@ -22,7 +22,7 @@ export async function fetchNui(eventName: string, data?: any): Promise< const resp = await fetch(`https://${resourceName}/${eventName}`, options); - const respFormatted = resp.json() + const respFormatted = await resp.json() return respFormatted -} \ No newline at end of file +}