aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/PrivateRoute.jsx9
-rw-r--r--src/utils/api.js21
2 files changed, 0 insertions, 30 deletions
diff --git a/src/utils/PrivateRoute.jsx b/src/utils/PrivateRoute.jsx
deleted file mode 100644
index b57bcf5..0000000
--- a/src/utils/PrivateRoute.jsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import React from 'react';
-import { Navigate } from 'react-router-dom';
-
-const PrivateRoute = ({ children }) => {
- const token = localStorage.getItem('token');
- return token ? children : <Navigate to="/" />;
-};
-
-export default PrivateRoute;
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();
-};