Hack to fix the urls.

This commit is contained in:
softsimon 2020-11-27 20:11:15 +07:00
parent 42d1fcbdee
commit dee9fa2d9a
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -34,7 +34,10 @@ export class HttpCacheInterceptor implements HttpInterceptor {
return next.handle(request)
.pipe(tap((event: HttpEvent<any>) => {
if (!this.isBrowser && event instanceof HttpResponse) {
const keyId = request.url.split('/').slice(3).join('/').replace('api/v1/', '');
let keyId = request.url.split('/').slice(3).join('/');
if (keyId.indexOf('api/') === -1) {
keyId = 'api/' + keyId;
}
this.transferState.set(makeStateKey('/' + keyId), event);
}
}));