22 lines
551 B
TypeScript
22 lines
551 B
TypeScript
import { api } from "@/lib/api/axiosInstance";
|
|
import {
|
|
CategoriesResponse,
|
|
FoodsResponse,
|
|
} from "@/app/[name]/(Main)/types/Types";
|
|
|
|
export const getFoods = async (slug: string): Promise<FoodsResponse> => {
|
|
const response = await api.get<FoodsResponse>(
|
|
`/public/foods/restaurant/${slug}`
|
|
);
|
|
return response.data;
|
|
};
|
|
|
|
export const getCategories = async (
|
|
slug: string
|
|
): Promise<CategoriesResponse> => {
|
|
const response = await api.get<CategoriesResponse>(
|
|
`/public/categories/restaurant/${slug}`
|
|
);
|
|
return response.data;
|
|
};
|