From cee88f63d9fef75c15786d283df86d88099227d6 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 2 Jul 2024 11:14:12 -0700 Subject: [PATCH] Make axios request --- Client/src/App.jsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Client/src/App.jsx b/Client/src/App.jsx index be667395a..193fbcb36 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -20,10 +20,26 @@ import NewPasswordConfirmed from "./Pages/NewPasswordConfirmed"; import ToastComponent from "./Components/Toast"; import ProtectedRoute from "./Components/ProtectedRoute"; import { useState, useEffect } from "react"; +import axios from "axios"; function App() { + const BASE_URL = import.meta.env.VITE_APP_API_BASE_URL; const [adminExists, setAdminExists] = useState(false); // Assuming admin exists by default + useEffect(() => { + const checkAdminExists = async () => { + try { + // Replace this URL with your actual API endpoint + const response = await axios.get(`${BASE_URL}/auth/users/admin`); + console.log(response); + } catch (error) { + console.error("Failed to check admin existence:", error); + } + }; + + checkAdminExists(); + }, []); + return ( <>