diff --git a/admin/src/Layout/Layout.tsx b/admin/src/Layout/Layout.tsx index b7df89a..f096e02 100644 --- a/admin/src/Layout/Layout.tsx +++ b/admin/src/Layout/Layout.tsx @@ -14,7 +14,7 @@ const Layout: React.FC = ({ children }) => { useEffect(() => { if (Cookies.get("token")) { const verifyToken = async () => { - const response = await fetch("http://localhost:8002/api/verifyToken", { + const response = await fetch("https://backend.insta.the1s.de/api/verifyToken", { method: "GET", headers: { Authorization: `Bearer ${Cookies.get("token")}`, diff --git a/admin/src/components/ItemTable.tsx b/admin/src/components/ItemTable.tsx index a1c9714..8c196ed 100644 --- a/admin/src/components/ItemTable.tsx +++ b/admin/src/components/ItemTable.tsx @@ -59,7 +59,7 @@ const ItemTable: React.FC = () => { const fetchData = async () => { setIsLoading(true); try { - const response = await fetch("http://localhost:8002/api/allItems", { + const response = await fetch("https://backend.insta.the1s.de/api/allItems", { method: "GET", headers: { Authorization: `Bearer ${Cookies.get("token")}`, diff --git a/admin/src/components/LoanTable.tsx b/admin/src/components/LoanTable.tsx index 43dcb47..ba39fa1 100644 --- a/admin/src/components/LoanTable.tsx +++ b/admin/src/components/LoanTable.tsx @@ -55,7 +55,7 @@ const LoanTable: React.FC = () => { const fetchData = async () => { setIsLoading(true); try { - const response = await fetch("http://localhost:8002/api/allLoans", { + const response = await fetch("https://backend.insta.the1s.de/api/allLoans", { method: "GET", headers: { Authorization: `Bearer ${Cookies.get("token")}`, diff --git a/admin/src/utils/fetcher.ts b/admin/src/utils/fetcher.ts index a3bee7d..fbab133 100644 --- a/admin/src/utils/fetcher.ts +++ b/admin/src/utils/fetcher.ts @@ -1,7 +1,7 @@ import Cookies from "js-cookie"; export const fetchUserData = async () => { - const response = await fetch("http://localhost:8002/api/allUsers", { + const response = await fetch("https://backend.insta.the1s.de/api/allUsers", { headers: { Authorization: `Bearer ${Cookies.get("token")}`, }, diff --git a/admin/src/utils/loginUser.ts b/admin/src/utils/loginUser.ts index 3a65c2b..d72cc58 100644 --- a/admin/src/utils/loginUser.ts +++ b/admin/src/utils/loginUser.ts @@ -13,7 +13,7 @@ export const loginFunc = async ( password: string ): Promise => { try { - const response = await fetch("http://localhost:8002/api/loginAdmin", { + const response = await fetch("https://backend.insta.the1s.de/api/loginAdmin", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ username, password }), diff --git a/admin/src/utils/userActions.ts b/admin/src/utils/userActions.ts index 4397755..7cdcaef 100644 --- a/admin/src/utils/userActions.ts +++ b/admin/src/utils/userActions.ts @@ -3,7 +3,7 @@ import Cookies from "js-cookie"; export const handleDelete = async (userId: number) => { try { const response = await fetch( - `http://localhost:8002/api/deleteUser/${userId}`, + `https://backend.insta.the1s.de/api/deleteUser/${userId}`, { method: "DELETE", headers: { @@ -29,7 +29,7 @@ export const handleEdit = async ( ) => { try { const response = await fetch( - `http://localhost:8002/api/editUser/${userId}`, + `https://backend.insta.the1s.de/api/editUser/${userId}`, { method: "PUT", headers: { @@ -55,7 +55,7 @@ export const createUser = async ( password: string ) => { try { - const response = await fetch(`http://localhost:8002/api/createUser`, { + const response = await fetch(`https://backend.insta.the1s.de/api/createUser`, { method: "POST", headers: { "Content-Type": "application/json", @@ -76,7 +76,7 @@ export const createUser = async ( export const deleteLoan = async (loanId: number) => { try { const response = await fetch( - `http://localhost:8002/api/deleteLoan/${loanId}`, + `https://backend.insta.the1s.de/api/deleteLoan/${loanId}`, { method: "DELETE", headers: { @@ -97,7 +97,7 @@ export const deleteLoan = async (loanId: number) => { export const deleteItem = async (itemId: number) => { try { const response = await fetch( - `http://localhost:8002/api/deleteItem/${itemId}`, + `https://backend.insta.the1s.de/api/deleteItem/${itemId}`, { method: "DELETE", headers: { @@ -120,7 +120,7 @@ export const createItem = async ( can_borrow_role: number ) => { try { - const response = await fetch(`http://localhost:8002/api/createItem`, { + const response = await fetch(`https://backend.insta.the1s.de/api/createItem`, { method: "POST", headers: { "Content-Type": "application/json", diff --git a/frontend/src/utils/userHandler.ts b/frontend/src/utils/userHandler.ts index 8a3149f..89793ba 100644 --- a/frontend/src/utils/userHandler.ts +++ b/frontend/src/utils/userHandler.ts @@ -103,7 +103,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/api/returnLoan/${loanID}`, { method: "POST", headers: { @@ -122,7 +122,7 @@ export const onReturn = async (loanID: number) => { }; export const onTake = async (loanID: number) => { - const response = await fetch(`http://localhost:8002/api/takeLoan/${loanID}`, { + const response = await fetch(`https://backend.insta.the1s.de/api/takeLoan/${loanID}`, { method: "POST", headers: { Authorization: `Bearer ${Cookies.get("token") || ""}`,