fix build error

This commit is contained in:
hamid zarghami
2025-12-23 09:49:29 +03:30
parent 8135de464d
commit 9f12eb3932
2 changed files with 8 additions and 12 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -7
View File
@@ -1,17 +1,14 @@
import { API_BASE_URL } from "@/config/const"; import { API_BASE_URL } from "@/config/const";
import { AboutResponse, Restaurant } from "./(Main)/about/types/Types"; import { AboutResponse, Restaurant } from "../(Main)/about/types/Types";
export async function getRestaurant(slug: string): Promise<Restaurant> { export async function getRestaurant(slug: string): Promise<Restaurant> {
try { try {
const response = await fetch( const response = await fetch(`${API_BASE_URL}/public/restaurants/${slug}`, {
`${API_BASE_URL}/public/restaurants/${slug}`,
{
cache: "no-store", cache: "no-store",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
}, },
} });
);
if (!response.ok) { if (!response.ok) {
if (response.status === 404) { if (response.status === 404) {
@@ -34,4 +31,3 @@ export async function getRestaurant(slug: string): Promise<Restaurant> {
throw new Error(`Failed to fetch restaurant data: ${error}`); throw new Error(`Failed to fetch restaurant data: ${error}`);
} }
} }