2023-05-30 09:26:50 +03:00

37 lines
1.2 KiB
TypeScript

import { Injectable } from '@angular/core';
import { FuseMockApiService } from '@fuse/lib/mock-api';
import { analytics as analyticsData } from 'app/mock-api/dashboards/analytics/data';
import { cloneDeep } from 'lodash-es';
@Injectable({providedIn: 'root'})
export class AnalyticsMockApi
{
private _analytics: any = analyticsData;
/**
* Constructor
*/
constructor(private _fuseMockApiService: FuseMockApiService)
{
// Register Mock API handlers
this.registerHandlers();
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Register Mock API handlers
*/
registerHandlers(): void
{
// -----------------------------------------------------------------------------------------------------
// @ Sales - GET
// -----------------------------------------------------------------------------------------------------
this._fuseMockApiService
.onGet('api/dashboards/analytics')
.reply(() => [200, cloneDeep(this._analytics)]);
}
}