frontend: big upgrade

This commit is contained in:
tylen
2025-10-31 17:30:08 +02:00
parent 3f074e895d
commit 5baeee1f97
10 changed files with 90 additions and 49 deletions

View File

@@ -1,5 +1,6 @@
import { useState, useEffect } from 'react';
import type { Hosting } from '../types';
import { API_URL } from '../constants/constants';
const mockData: Hosting = {
1: {
@@ -33,7 +34,7 @@ const useFetchHosting = () => {
setLoading(true);
setError(null);
try {
const response = await fetch('/hosting');
const response = await fetch(`${API_URL}/hosting`);
if (response.status != 200) {
throw new Error('Network response was not ok');
}
@@ -48,7 +49,7 @@ const useFetchHosting = () => {
setLoading(true);
setError(null);
try {
const response = await fetch(`/hosting/${id}`, {
const response = await fetch(`${API_URL}/hosting/${id}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',