list of foods and categories
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user