mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
26 lines
862 B
TypeScript
26 lines
862 B
TypeScript
import { BaseApiService } from '@/services/api/base';
|
|
import { BaseApiResponse } from '@/types/api/api-general';
|
|
import { Dashboard } from '@/types/api/dashboard/dashboard';
|
|
import { httpClientFetcher } from '@/services/http/client';
|
|
|
|
class DashboardService extends BaseApiService<Dashboard, unknown, unknown> {
|
|
constructor(basePath: string) {
|
|
super(basePath);
|
|
}
|
|
|
|
/**
|
|
* Fetch dashboard production data
|
|
* @param endpoint - The endpoint URL with query parameters
|
|
* @returns Promise with BaseApiResponse containing DashboardProduction
|
|
*/
|
|
async getDashboardProductionFetcher(
|
|
endpoint: string
|
|
): Promise<BaseApiResponse<Dashboard> | undefined> {
|
|
return await httpClientFetcher<BaseApiResponse<Dashboard>>(
|
|
`${endpoint ? endpoint : this.basePath}`
|
|
);
|
|
}
|
|
}
|
|
|
|
export const DashboardApi = new DashboardService('/dashboards');
|