From bb7f66ecc706da9700f0462d1d9692f8c90e7bc2 Mon Sep 17 00:00:00 2001 From: Theis Gaedigk Date: Thu, 28 Aug 2025 21:15:37 +0200 Subject: [PATCH] changed urls --- frontend/src/utils/userHandler.ts | 36 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/frontend/src/utils/userHandler.ts b/frontend/src/utils/userHandler.ts index 8a3149f..e2640f9 100644 --- a/frontend/src/utils/userHandler.ts +++ b/frontend/src/utils/userHandler.ts @@ -75,14 +75,17 @@ export const rmFromRemove = (itemID: number) => { export const createLoan = async (startDate: string, endDate: string) => { const items = removeArr; - const response = await fetch("https://backend.insta.the1s.de/api/createLoan", { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${Cookies.get("token") || ""}`, - }, - body: JSON.stringify({ items, startDate, endDate }), - }); + const response = await fetch( + "https://backend.insta.the1s.de/api/createLoan", + { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${Cookies.get("token") || ""}`, + }, + body: JSON.stringify({ items, startDate, endDate }), + } + ); if (!response.ok) { myToast("Fehler beim Erstellen der Ausleihe", "error"); @@ -103,7 +106,7 @@ export const createLoan = async (startDate: string, endDate: string) => { export const onReturn = async (loanID: number) => { const response = await fetch( - `http://localhost:8002/api/returnLoan/${loanID}`, + `https://backend.insta.the1s.de/returnLoan/${loanID}`, { method: "POST", headers: { @@ -122,12 +125,15 @@ export const onReturn = async (loanID: number) => { }; export const onTake = async (loanID: number) => { - const response = await fetch(`http://localhost:8002/api/takeLoan/${loanID}`, { - method: "POST", - headers: { - Authorization: `Bearer ${Cookies.get("token") || ""}`, - }, - }); + const response = await fetch( + `https://backend.insta.the1s.de/takeLoan/${loanID}`, + { + method: "POST", + headers: { + Authorization: `Bearer ${Cookies.get("token") || ""}`, + }, + } + ); if (!response.ok) { myToast("Fehler beim Ausleihen der Ausleihe", "error");