From 5777f96394444dab18a81d6f085ac81df3e62008 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 25 Feb 2025 23:13:39 -0500 Subject: 2.13 Release (finally); Added more API entries; Proper logging --- web/src/components/Quotes.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'web/src/components') diff --git a/web/src/components/Quotes.jsx b/web/src/components/Quotes.jsx index 831408d..1eb258a 100644 --- a/web/src/components/Quotes.jsx +++ b/web/src/components/Quotes.jsx @@ -1,12 +1,13 @@ import { useState, useEffect } from 'react'; import '../styles/Quote.css' +import { API_URL } from "astro:env/client"; export function PendingQuotes() { const [quotes, setQuotes] = useState([]); const fetchQuotes = async () => { try { - const response = await fetch('http://localhost:3000/api/pending-quotes'); + const response = await fetch(`${API_URL}/api/pending-quotes`); const data = await response.json(); setQuotes(data); } catch (error) { @@ -20,7 +21,7 @@ export function PendingQuotes() { const approveQuote = async (id) => { try { - const response = await fetch('http://localhost:3000/api/approve-quote', { + const response = await fetch(`${API_URL}/api/approve-quote`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -40,7 +41,7 @@ export function PendingQuotes() { const rejectQuote = async (id) => { try { - const response = await fetch('http://localhost:3000/api/reject-quote', { + const response = await fetch(`${API_URL}/api/reject-quote`, { method: 'POST', headers: { 'Content-Type': 'application/json', -- cgit v1.2.3