chart edited

This commit is contained in:
hamid zarghami
2025-12-24 15:18:21 +03:30
parent 7797f47a7e
commit 2fd013d282
8 changed files with 275 additions and 129 deletions
@@ -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;
};