up
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-06-26 16:00:53 +03:30
parent b4010c09d6
commit d5e4803b04
4 changed files with 60 additions and 23 deletions
@@ -0,0 +1,9 @@
import { useQuery } from '@tanstack/react-query';
import * as api from '../service/DashboardService';
export const useGetDashboardCounts = () => {
return useQuery({
queryKey: ['dashboard-counts'],
queryFn: () => api.getDashboardCounts(),
});
};
@@ -0,0 +1,14 @@
import axios from '@/config/axios';
import type { BaseResponse } from '@/shared/types/Types';
export type DashboardCountsType = {
requestsCount: number;
invoicesCount: number;
ordersCount: number;
paymentsCount: number;
};
export const getDashboardCounts = async (): Promise<BaseResponse<DashboardCountsType>> => {
const { data } = await axios.get<BaseResponse<DashboardCountsType>>('/admin/dashboard/counts');
return data;
};