first commit
This commit is contained in:
26
frontend/app/utils/api/productDashboardApi/index.tsx
Normal file
26
frontend/app/utils/api/productDashboardApi/index.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { baseApiRequest } from "../apiRequests/baseApiRequest";
|
||||
import { DashboardWidgetsResponseDto, StatusWiseProjectResponseData } from "./types";
|
||||
|
||||
const PROJECT_DASHBOARD_API = `${process.env.NEXT_PUBLIC_PROJECT_MANAGEMENT_API_URL}/api/v1/dashboard`;
|
||||
|
||||
export const getWidgetsData: () => Promise<DashboardWidgetsResponseDto> = async () => {
|
||||
return baseApiRequest(
|
||||
`${PROJECT_DASHBOARD_API}/widgets`,
|
||||
{
|
||||
method: "GET",
|
||||
cache: "no-store",
|
||||
},
|
||||
{ isAccessTokenRequird: true },
|
||||
);
|
||||
};
|
||||
|
||||
export const getStatusWiseProjectCount: () => Promise<StatusWiseProjectResponseData> = async () => {
|
||||
return baseApiRequest(
|
||||
`${PROJECT_DASHBOARD_API}/status-wise-projects`,
|
||||
{
|
||||
method: "GET",
|
||||
cache: "no-store",
|
||||
},
|
||||
{ isAccessTokenRequird: true },
|
||||
);
|
||||
};
|
||||
10
frontend/app/utils/api/productDashboardApi/types.ts
Normal file
10
frontend/app/utils/api/productDashboardApi/types.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export interface StatusWiseProjectResponseData {
|
||||
status: string;
|
||||
projectCount: number;
|
||||
}
|
||||
|
||||
export interface DashboardWidgetsResponseDto {
|
||||
totalProjects: number;
|
||||
totalIssues: number;
|
||||
totalRisksCount: number;
|
||||
}
|
||||
Reference in New Issue
Block a user