From 9c3492d272c7448e851f5805b748eaa2341ad48a Mon Sep 17 00:00:00 2001 From: GAURAV singh Date: Thu, 25 Jun 2026 01:07:56 +0530 Subject: [PATCH 1/2] BUGFIX: add missing await bug --- src/api.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/api.js diff --git a/src/api.js b/src/api.js new file mode 100644 index 0000000..c064db5 --- /dev/null +++ b/src/api.js @@ -0,0 +1,5 @@ +async function fetchAndProcess(url) { + const response = fetch(url); + const data = response.json(); + return data.items; +} From 81719642362d823de0ea01c1f462451d68dd9d91 Mon Sep 17 00:00:00 2001 From: GAURAV singh Date: Thu, 25 Jun 2026 01:17:56 +0530 Subject: [PATCH 2/2] Apply AI-generated fixes - src/api.js: Added 'await' to fetch and response.json() to handle asynchronous operations correctly. --- src/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api.js b/src/api.js index c064db5..cba3f7f 100644 --- a/src/api.js +++ b/src/api.js @@ -1,5 +1,5 @@ async function fetchAndProcess(url) { - const response = fetch(url); - const data = response.json(); + const response = await fetch(url); + const data = await response.json(); return data.items; }