32 lines
783 B
TypeScript
32 lines
783 B
TypeScript
import { api } from "@/config/axios";
|
|
import {
|
|
CategoriesResponse,
|
|
FoodsResponse,
|
|
NotificationsCountResponse,
|
|
} from "../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;
|
|
};
|
|
|
|
export const getNotificationsCount = async (): Promise<
|
|
NotificationsCountResponse
|
|
> => {
|
|
const response = await api.get<NotificationsCountResponse>(
|
|
`/public/notifications/unseen-count`
|
|
);
|
|
return response.data;
|
|
};
|