updates on the orders page about four kpis
This commit is contained in:
@@ -27,8 +27,11 @@ export const fetchAppLocations = async () => {
|
||||
|
||||
// ==============================|| fetchPercentageData (orders) ||============================== //
|
||||
|
||||
export const fetchPercentageData = async (appId) => {
|
||||
const response = await axios.get(`${process.env.REACT_APP_URL}/orders/getordersummary/?applocationid=${appId}`);
|
||||
export const fetchPercentageData = async ({ queryKey }) => {
|
||||
const [, appId, startdate, enddate, tenantid, locationid] = queryKey;
|
||||
const response = await axios.get(
|
||||
`${process.env.REACT_APP_URL}/orders/getordersummary/?applocationid=${appId}&tenantid=${tenantid}&locationid=${locationid}&fromdate=${startdate}&todate=${enddate}`
|
||||
);
|
||||
const details = response.data.details;
|
||||
|
||||
return {
|
||||
@@ -42,6 +45,7 @@ export const fetchPercentageData = async (appId) => {
|
||||
percentage4: (Math.round((details.cancelled / details.total) * 100) || 0).toString()
|
||||
};
|
||||
};
|
||||
|
||||
// ===================================================== || getTenants || =====================================================
|
||||
|
||||
export const getTenants = async (appId) => {
|
||||
|
||||
Reference in New Issue
Block a user