frontend: big upgrade
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user