revenuechart dynamic
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import axios from "@/config/axios";
|
||||
import type { IStatisticsResponse } from "../types/Types";
|
||||
import type {
|
||||
IStatisticsResponse,
|
||||
IPaymentChartResponse,
|
||||
} from "../types/Types";
|
||||
|
||||
export const getStatistics = async (): Promise<IStatisticsResponse> => {
|
||||
const { data } = await axios.get<IStatisticsResponse>("/admin/orders/stats");
|
||||
@@ -10,3 +13,19 @@ export const getFoodSalesPieChart = async () => {
|
||||
const { data } = await axios.get("/admin/orders/food-sales-pie-chart");
|
||||
return data;
|
||||
};
|
||||
|
||||
interface GetPaymentsChartParams {
|
||||
period?: "daily" | "monthly" | "yearly";
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
}
|
||||
|
||||
export const getPaymentsChart = async (
|
||||
params?: GetPaymentsChartParams
|
||||
): Promise<IPaymentChartResponse> => {
|
||||
const { data } = await axios.get<IPaymentChartResponse>(
|
||||
"/admin/payments/chart",
|
||||
{ params }
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user