From bd933a5aace3ac4944bfe7f4b58b4908978b4950 Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Thu, 1 Aug 2024 17:49:26 +0530 Subject: merge --- src/utils/api.js | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 src/utils/api.js (limited to 'src/utils/api.js') diff --git a/src/utils/api.js b/src/utils/api.js deleted file mode 100644 index 7b63aa4..0000000 --- a/src/utils/api.js +++ /dev/null @@ -1,21 +0,0 @@ -export const fetchAds = async () => { - const response = await fetch('http://localhost:5000/ads'); - if (!response.ok) { - throw new Error('Network response was not ok'); - } - return response.json(); -}; - -export const addAd = async (ad) => { - const response = await fetch('http://localhost:5000/ads', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(ad), - }); - if (!response.ok) { - throw new Error('Network response was not ok'); - } - return response.json(); -}; -- cgit v1.2.3-59-g8ed1b