chart edited
This commit is contained in:
@@ -2,6 +2,7 @@ import axios from "@/config/axios";
|
||||
import type {
|
||||
IStatisticsResponse,
|
||||
IPaymentChartResponse,
|
||||
IFoodSalesPieChartResponse,
|
||||
} from "../types/Types";
|
||||
|
||||
export const getStatistics = async (): Promise<IStatisticsResponse> => {
|
||||
@@ -9,8 +10,19 @@ export const getStatistics = async (): Promise<IStatisticsResponse> => {
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getFoodSalesPieChart = async () => {
|
||||
const { data } = await axios.get("/admin/orders/food-sales-pie-chart");
|
||||
interface GetFoodSalesPieChartParams {
|
||||
period?: "daily" | "monthly" | "yearly";
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
}
|
||||
|
||||
export const getFoodSalesPieChart = async (
|
||||
params?: GetFoodSalesPieChartParams
|
||||
): Promise<IFoodSalesPieChartResponse> => {
|
||||
const { data } = await axios.get<IFoodSalesPieChartResponse>(
|
||||
"/admin/orders/food-sales-pie-chart",
|
||||
{ params }
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user