mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 13:55:45 +00:00
feat(FE): API integration dashboard
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { BaseApiService } from '@/services/api/base';
|
||||
import { BaseApiResponse } from '@/types/api/api-general';
|
||||
import { Dashboard } from '@/types/api/dashboard/dashboard';
|
||||
import { getDummySingle } from '@/dummy/dashboard/dashboard.production.dummy';
|
||||
import { httpClientFetcher } from '@/services/http/client';
|
||||
|
||||
class DashboardService extends BaseApiService<Dashboard, unknown, unknown> {
|
||||
constructor(basePath: string) {
|
||||
@@ -12,19 +12,14 @@ class DashboardService extends BaseApiService<Dashboard, unknown, unknown> {
|
||||
* Fetch dashboard production data
|
||||
* @param endpoint - The endpoint URL with query parameters
|
||||
* @returns Promise with BaseApiResponse containing DashboardProduction
|
||||
*
|
||||
* Note: Currently using dummy data. When real API is ready,
|
||||
* uncomment the line below and remove getDummySingle() call:
|
||||
* return await this.customRequest<BaseApiResponse<Dashboard>>(endpoint);
|
||||
*/
|
||||
async getDashboardProductionFetcher(
|
||||
endpoint: string
|
||||
): Promise<BaseApiResponse<Dashboard>> {
|
||||
// For now, we're using dummy data regardless of the endpoint
|
||||
// The endpoint parameter is kept for future API integration
|
||||
console.log('Fetching dashboard data with endpoint:', endpoint);
|
||||
return await getDummySingle();
|
||||
): Promise<BaseApiResponse<Dashboard> | undefined> {
|
||||
return await httpClientFetcher<BaseApiResponse<Dashboard>>(
|
||||
`${endpoint ? endpoint : this.basePath}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const DashboardApi = new DashboardService('/dashboard');
|
||||
export const DashboardApi = new DashboardService('/dashboards');
|
||||
|
||||
Reference in New Issue
Block a user