diff --git a/src/app/_services/api/api.service.ts b/src/app/_services/api/api.service.ts index 358b897..df4c230 100644 --- a/src/app/_services/api/api.service.ts +++ b/src/app/_services/api/api.service.ts @@ -111,7 +111,12 @@ export class ApiService { } private _dummy_api_url(path: string) { - return path.replace(/^(.*)\/api\/(.*)$/, '/assets/json/$2.json'); + if (path.search('/api/') !== -1) { + const arr = path.split('/api/'); + if (arr.length > 0) { + return `/assets/json/${arr[arr.length - 1]}.json`; + } + } } private _getOne(id: number, endpointName: string): Observable {