changed links for hosting
This commit is contained in:
@@ -14,7 +14,7 @@ const Layout: React.FC<LayoutProps> = ({ 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")}`,
|
||||
|
@@ -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")}`,
|
||||
|
@@ -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")}`,
|
||||
|
@@ -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")}`,
|
||||
},
|
||||
|
@@ -13,7 +13,7 @@ export const loginFunc = async (
|
||||
password: string
|
||||
): Promise<LoginResult> => {
|
||||
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 }),
|
||||
|
@@ -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",
|
||||
|
@@ -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") || ""}`,
|
||||
|
Reference in New Issue
Block a user