fix build error
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -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",
|
||||||
{
|
headers: {
|
||||||
cache: "no-store",
|
"Content-Type": "application/json",
|
||||||
headers: {
|
},
|
||||||
"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}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user