diff --git a/src/Squidex/app/features/administration/services/event-consumers.service.ts b/src/Squidex/app/features/administration/services/event-consumers.service.ts index 18ebdc7ca..2aa592765 100644 --- a/src/Squidex/app/features/administration/services/event-consumers.service.ts +++ b/src/Squidex/app/features/administration/services/event-consumers.service.ts @@ -62,12 +62,12 @@ export class EventConsumersService { const url = this.apiUrl.buildUrl('/api/event-consumers'); return this.http.get<{ items: any[] } & Resource>(url).pipe( - map(({ items, _links }) => { - const eventConsumers = items.map(item => parseEventConsumer(item)); + map(({ items, _links }) => { + const eventConsumers = items.map(item => parseEventConsumer(item)); - return new EventConsumersDto(eventConsumers, _links); - }), - pretifyError('Failed to load event consumers. Please reload.')); + return new EventConsumersDto(eventConsumers, _links); + }), + pretifyError('Failed to load event consumers. Please reload.')); } public putStart(eventConsumer: Resource): Observable { @@ -76,10 +76,10 @@ export class EventConsumersService { const url = this.apiUrl.buildUrl(link.href); return this.http.request(link.method, url).pipe( - map(body => { - return parseEventConsumer(body); - }), - pretifyError('Failed to start event consumer. Please reload.')); + map(body => { + return parseEventConsumer(body); + }), + pretifyError('Failed to start event consumer. Please reload.')); } public putStop(eventConsumer: Resource): Observable { @@ -88,10 +88,10 @@ export class EventConsumersService { const url = this.apiUrl.buildUrl(link.href); return this.http.request(link.method, url).pipe( - map(body => { - return parseEventConsumer(body); - }), - pretifyError('Failed to stop event consumer. Please reload.')); + map(body => { + return parseEventConsumer(body); + }), + pretifyError('Failed to stop event consumer. Please reload.')); } public putReset(eventConsumer: Resource): Observable { @@ -100,10 +100,10 @@ export class EventConsumersService { const url = this.apiUrl.buildUrl(link.href); return this.http.request(link.method, url).pipe( - map(body => { - return parseEventConsumer(body); - }), - pretifyError('Failed to reset event consumer. Please reload.')); + map(body => { + return parseEventConsumer(body); + }), + pretifyError('Failed to reset event consumer. Please reload.')); } } diff --git a/src/Squidex/app/features/administration/services/users.service.ts b/src/Squidex/app/features/administration/services/users.service.ts index c7975aa9b..3d6cc1a05 100644 --- a/src/Squidex/app/features/administration/services/users.service.ts +++ b/src/Squidex/app/features/administration/services/users.service.ts @@ -73,32 +73,32 @@ export class UsersService { const url = this.apiUrl.buildUrl(`api/user-management?take=${take}&skip=${skip}&query=${query || ''}`); return this.http.get<{ total: number, items: any[] } & Resource>(url).pipe( - map(({ total, items, _links }) => { - const users = items.map(item => parseUser(item)); + map(({ total, items, _links }) => { + const users = items.map(item => parseUser(item)); - return new UsersDto(total, users, _links); - }), - pretifyError('Failed to load users. Please reload.')); + return new UsersDto(total, users, _links); + }), + pretifyError('Failed to load users. Please reload.')); } public getUser(id: string): Observable { const url = this.apiUrl.buildUrl(`api/user-management/${id}`); return this.http.get(url).pipe( - map(body => { - return parseUser(body); - }), - pretifyError('Failed to load user. Please reload.')); + map(body => { + return parseUser(body); + }), + pretifyError('Failed to load user. Please reload.')); } public postUser(dto: CreateUserDto): Observable { const url = this.apiUrl.buildUrl('api/user-management'); return this.http.post(url, dto).pipe( - map(body => { - return parseUser(body); - }), - pretifyError('Failed to create user. Please reload.')); + map(body => { + return parseUser(body); + }), + pretifyError('Failed to create user. Please reload.')); } public putUser(user: Resource, dto: UpdateUserDto): Observable { @@ -107,10 +107,10 @@ export class UsersService { const url = this.apiUrl.buildUrl(link.href); return this.http.request(link.method, url, { body: dto }).pipe( - map(body => { - return parseUser(body); - }), - pretifyError('Failed to update user. Please reload.')); + map(body => { + return parseUser(body); + }), + pretifyError('Failed to update user. Please reload.')); } public lockUser(user: Resource): Observable { @@ -119,10 +119,10 @@ export class UsersService { const url = this.apiUrl.buildUrl(link.href); return this.http.request(link.method, url).pipe( - map(body => { - return parseUser(body); - }), - pretifyError('Failed to load users. Please retry.')); + map(body => { + return parseUser(body); + }), + pretifyError('Failed to load users. Please retry.')); } public unlockUser(user: Resource): Observable { @@ -131,10 +131,10 @@ export class UsersService { const url = this.apiUrl.buildUrl(link.href); return this.http.request(link.method, url).pipe( - map(body => { - return parseUser(body); - }), - pretifyError('Failed to load users. Please retry.')); + map(body => { + return parseUser(body); + }), + pretifyError('Failed to load users. Please retry.')); } } diff --git a/src/Squidex/app/shared/services/app-languages.service.ts b/src/Squidex/app/shared/services/app-languages.service.ts index 23a7a486e..eb13fb708 100644 --- a/src/Squidex/app/shared/services/app-languages.service.ts +++ b/src/Squidex/app/shared/services/app-languages.service.ts @@ -74,23 +74,23 @@ export class AppLanguagesService { const url = this.apiUrl.buildUrl(`api/apps/${appName}/languages`); return HTTP.getVersioned(this.http, url).pipe( - mapVersioned(({ body }) => { - return parseLanguages(body); - }), - pretifyError('Failed to load languages. Please reload.')); + mapVersioned(({ body }) => { + return parseLanguages(body); + }), + pretifyError('Failed to load languages. Please reload.')); } public postLanguage(appName: string, dto: AddAppLanguageDto, version: Version): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/languages`); return HTTP.postVersioned(this.http, url, dto, version).pipe( - mapVersioned(({ body }) => { - return parseLanguages(body); - }), - tap(() => { - this.analytics.trackEvent('Language', 'Added', appName); - }), - pretifyError('Failed to add language. Please reload.')); + mapVersioned(({ body }) => { + return parseLanguages(body); + }), + tap(() => { + this.analytics.trackEvent('Language', 'Added', appName); + }), + pretifyError('Failed to add language. Please reload.')); } public putLanguage(appName: string, resource: Resource, dto: UpdateAppLanguageDto, version: Version): Observable { @@ -99,13 +99,13 @@ export class AppLanguagesService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version, dto).pipe( - mapVersioned(({ body }) => { - return parseLanguages(body); - }), - tap(() => { - this.analytics.trackEvent('Language', 'Updated', appName); - }), - pretifyError('Failed to change language. Please reload.')); + mapVersioned(({ body }) => { + return parseLanguages(body); + }), + tap(() => { + this.analytics.trackEvent('Language', 'Updated', appName); + }), + pretifyError('Failed to change language. Please reload.')); } public deleteLanguage(appName: string, resource: Resource, version: Version): Observable { @@ -114,13 +114,13 @@ export class AppLanguagesService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version).pipe( - mapVersioned(({ body }) => { - return parseLanguages(body); - }), - tap(() => { - this.analytics.trackEvent('Language', 'Deleted', appName); - }), - pretifyError('Failed to add language. Please reload.')); + mapVersioned(({ body }) => { + return parseLanguages(body); + }), + tap(() => { + this.analytics.trackEvent('Language', 'Deleted', appName); + }), + pretifyError('Failed to add language. Please reload.')); } } diff --git a/src/Squidex/app/shared/services/apps.service.ts b/src/Squidex/app/shared/services/apps.service.ts index ea2c049b0..878bed2ad 100644 --- a/src/Squidex/app/shared/services/apps.service.ts +++ b/src/Squidex/app/shared/services/apps.service.ts @@ -86,25 +86,25 @@ export class AppsService { const url = this.apiUrl.buildUrl('/api/apps'); return this.http.get(url).pipe( - map(body => { - const apps = body.map(item => parseApp(item)); + map(body => { + const apps = body.map(item => parseApp(item)); - return apps; - }), - pretifyError('Failed to load apps. Please reload.')); + return apps; + }), + pretifyError('Failed to load apps. Please reload.')); } public postApp(dto: CreateAppDto): Observable { const url = this.apiUrl.buildUrl('api/apps'); return this.http.post(url, dto).pipe( - map(body => { - return parseApp(body); - }), - tap(() => { - this.analytics.trackEvent('App', 'Created', dto.name); - }), - pretifyError('Failed to create app. Please reload.')); + map(body => { + return parseApp(body); + }), + tap(() => { + this.analytics.trackEvent('App', 'Created', dto.name); + }), + pretifyError('Failed to create app. Please reload.')); } public deleteApp(resource: Resource): Observable { @@ -113,10 +113,10 @@ export class AppsService { const url = this.apiUrl.buildUrl(link.href); return this.http.request(link.method, url).pipe( - tap(() => { - this.analytics.trackEvent('App', 'Archived'); - }), - pretifyError('Failed to archive app. Please reload.')); + tap(() => { + this.analytics.trackEvent('App', 'Archived'); + }), + pretifyError('Failed to archive app. Please reload.')); } } diff --git a/src/Squidex/app/shared/services/assets.service.ts b/src/Squidex/app/shared/services/assets.service.ts index 8fd9e0fbd..b058e8a2d 100644 --- a/src/Squidex/app/shared/services/assets.service.ts +++ b/src/Squidex/app/shared/services/assets.service.ts @@ -138,12 +138,12 @@ export class AssetsService { const url = this.apiUrl.buildUrl(`api/apps/${appName}/assets?${fullQuery}`); return this.http.get<{ total: number, items: any[] } & Resource>(url).pipe( - map(({ total, items, _links }) => { - const assets = items.map(item => parseAsset(item)); + map(({ total, items, _links }) => { + const assets = items.map(item => parseAsset(item)); - return new AssetsDto(total, assets, _links); - }), - pretifyError('Failed to load assets. Please reload.')); + return new AssetsDto(total, assets, _links); + }), + pretifyError('Failed to load assets. Please reload.')); } public uploadFile(appName: string, file: File): Observable { @@ -152,45 +152,45 @@ export class AssetsService { const req = new HttpRequest('POST', url, getFormData(file), { reportProgress: true }); return this.http.request(req).pipe( - filter(event => - event.type === HttpEventType.UploadProgress || - event.type === HttpEventType.Response), - map(event => { - if (event.type === HttpEventType.UploadProgress) { - const percentDone = event.total ? Math.round(100 * event.loaded / event.total) : 0; - - return percentDone; - } else if (Types.is(event, HttpResponse)) { - return parseAsset(event.body); - } else { - throw 'Invalid'; - } - }), - catchError((error: any) => { - if (Types.is(error, HttpErrorResponse) && error.status === 413) { - return throwError(new ErrorDto(413, 'Asset is too big.')); - } else { - return throwError(error); - } - }), - tap(value => { - if (!Types.isNumber(value)) { - this.analytics.trackEvent('Asset', 'Uploaded', appName); - } - }), - pretifyError('Failed to upload asset. Please reload.')); + filter(event => + event.type === HttpEventType.UploadProgress || + event.type === HttpEventType.Response), + map(event => { + if (event.type === HttpEventType.UploadProgress) { + const percentDone = event.total ? Math.round(100 * event.loaded / event.total) : 0; + + return percentDone; + } else if (Types.is(event, HttpResponse)) { + return parseAsset(event.body); + } else { + throw 'Invalid'; + } + }), + catchError((error: any) => { + if (Types.is(error, HttpErrorResponse) && error.status === 413) { + return throwError(new ErrorDto(413, 'Asset is too big.')); + } else { + return throwError(error); + } + }), + tap(value => { + if (!Types.isNumber(value)) { + this.analytics.trackEvent('Asset', 'Uploaded', appName); + } + }), + pretifyError('Failed to upload asset. Please reload.')); } public getAsset(appName: string, id: string): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/assets/${id}`); return HTTP.getVersioned(this.http, url).pipe( - map(({ payload }) => { - const body = payload.body; + map(({ payload }) => { + const body = payload.body; - return parseAsset(body); - }), - pretifyError('Failed to load assets. Please reload.')); + return parseAsset(body); + }), + pretifyError('Failed to load assets. Please reload.')); } public replaceFile(appName: string, asset: Resource, file: File, version: Version): Observable { @@ -201,33 +201,33 @@ export class AssetsService { const req = new HttpRequest(link.method, url, getFormData(file), { headers: new HttpHeaders().set('If-Match', version.value), reportProgress: true }); return this.http.request(req).pipe( - filter(event => - event.type === HttpEventType.UploadProgress || - event.type === HttpEventType.Response), - map(event => { - if (event.type === HttpEventType.UploadProgress) { - const percentDone = event.total ? Math.round(100 * event.loaded / event.total) : 0; - - return percentDone; - } else if (Types.is(event, HttpResponse)) { - return parseAsset(event.body); - } else { - throw 'Invalid'; - } - }), - catchError(error => { - if (Types.is(error, HttpErrorResponse) && error.status === 413) { - return throwError(new ErrorDto(413, 'Asset is too big.')); - } else { - return throwError(error); - } - }), - tap(value => { - if (!Types.isNumber(value)) { - this.analytics.trackEvent('Analytics', 'Replaced', appName); - } - }), - pretifyError('Failed to replace asset. Please reload.')); + filter(event => + event.type === HttpEventType.UploadProgress || + event.type === HttpEventType.Response), + map(event => { + if (event.type === HttpEventType.UploadProgress) { + const percentDone = event.total ? Math.round(100 * event.loaded / event.total) : 0; + + return percentDone; + } else if (Types.is(event, HttpResponse)) { + return parseAsset(event.body); + } else { + throw 'Invalid'; + } + }), + catchError(error => { + if (Types.is(error, HttpErrorResponse) && error.status === 413) { + return throwError(new ErrorDto(413, 'Asset is too big.')); + } else { + return throwError(error); + } + }), + tap(value => { + if (!Types.isNumber(value)) { + this.analytics.trackEvent('Analytics', 'Replaced', appName); + } + }), + pretifyError('Failed to replace asset. Please reload.')); } public putAsset(appName: string, asset: Resource, dto: AnnotateAssetDto, version: Version): Observable { @@ -236,13 +236,13 @@ export class AssetsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version, dto).pipe( - map(({ payload }) => { - return parseAsset(payload.body); - }), - tap(() => { - this.analytics.trackEvent('Analytics', 'Updated', appName); - }), - pretifyError('Failed to update asset. Please reload.')); + map(({ payload }) => { + return parseAsset(payload.body); + }), + tap(() => { + this.analytics.trackEvent('Analytics', 'Updated', appName); + }), + pretifyError('Failed to update asset. Please reload.')); } public deleteAsset(appName: string, asset: Resource, version: Version): Observable> { @@ -251,10 +251,10 @@ export class AssetsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version).pipe( - tap(() => { - this.analytics.trackEvent('Analytics', 'Deleted', appName); - }), - pretifyError('Failed to delete asset. Please reload.')); + tap(() => { + this.analytics.trackEvent('Analytics', 'Deleted', appName); + }), + pretifyError('Failed to delete asset. Please reload.')); } } diff --git a/src/Squidex/app/shared/services/auth.service.ts b/src/Squidex/app/shared/services/auth.service.ts index d168850a4..ea05e730a 100644 --- a/src/Squidex/app/shared/services/auth.service.ts +++ b/src/Squidex/app/shared/services/auth.service.ts @@ -75,15 +75,15 @@ export class AuthService { Log.logger = console; this.userManager = new UserManager({ - client_id: 'squidex-frontend', - scope: 'squidex-api openid profile email squidex-profile role permissions', - response_type: 'id_token token', - redirect_uri: apiUrl.buildUrl('login;'), - post_logout_redirect_uri: apiUrl.buildUrl('logout'), - silent_redirect_uri: apiUrl.buildUrl('client-callback-silent'), - popup_redirect_uri: apiUrl.buildUrl('client-callback-popup'), - authority: apiUrl.buildUrl('identity-server/'), - userStore: new WebStorageStateStore({ store: window.localStorage || window.sessionStorage }), + client_id: 'squidex-frontend', + scope: 'squidex-api openid profile email squidex-profile role permissions', + response_type: 'id_token token', + redirect_uri: apiUrl.buildUrl('login;'), + post_logout_redirect_uri: apiUrl.buildUrl('logout'), + silent_redirect_uri: apiUrl.buildUrl('client-callback-silent'), + popup_redirect_uri: apiUrl.buildUrl('client-callback-popup'), + authority: apiUrl.buildUrl('identity-server/'), + userStore: new WebStorageStateStore({ store: window.localStorage || window.sessionStorage }), automaticSilentRenew: true }); @@ -103,7 +103,7 @@ export class AuthService { } public logoutRedirect() { - this.userManager.signoutRedirect(); + this.userManager.signoutRedirect(); } public loginRedirect() { diff --git a/src/Squidex/app/shared/services/backups.service.ts b/src/Squidex/app/shared/services/backups.service.ts index 492290d84..3af49a2c7 100644 --- a/src/Squidex/app/shared/services/backups.service.ts +++ b/src/Squidex/app/shared/services/backups.service.ts @@ -85,51 +85,51 @@ export class BackupsService { const url = this.apiUrl.buildUrl(`api/apps/${appName}/backups`); return this.http.get<{ items: any[], _links: {} } & Resource>(url).pipe( - map(({ items, _links }) => { - const backups = items.map(item => parseBackup(item)); + map(({ items, _links }) => { + const backups = items.map(item => parseBackup(item)); - return new BackupsDto(backups, _links); - }), - pretifyError('Failed to load backups.')); + return new BackupsDto(backups, _links); + }), + pretifyError('Failed to load backups.')); } public getRestore(): Observable { const url = this.apiUrl.buildUrl(`api/apps/restore`); return this.http.get(url).pipe( - map(body => { - const restore = parseRestore(body); - - return restore; - }), - catchError(error => { - if (Types.is(error, HttpErrorResponse) && error.status === 404) { - return of(null); - } else { - return throwError(error); - } - }), - pretifyError('Failed to load backups.')); + map(body => { + const restore = parseRestore(body); + + return restore; + }), + catchError(error => { + if (Types.is(error, HttpErrorResponse) && error.status === 404) { + return of(null); + } else { + return throwError(error); + } + }), + pretifyError('Failed to load backups.')); } public postBackup(appName: string): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/backups`); return this.http.post(url, {}).pipe( - tap(() => { - this.analytics.trackEvent('Backup', 'Started', appName); - }), - pretifyError('Failed to start backup.')); + tap(() => { + this.analytics.trackEvent('Backup', 'Started', appName); + }), + pretifyError('Failed to start backup.')); } public postRestore(dto: StartRestoreDto): Observable { const url = this.apiUrl.buildUrl(`api/apps/restore`); return this.http.post(url, dto).pipe( - tap(() => { - this.analytics.trackEvent('Restore', 'Started'); - }), - pretifyError('Failed to start restore.')); + tap(() => { + this.analytics.trackEvent('Restore', 'Started'); + }), + pretifyError('Failed to start restore.')); } public deleteBackup(appName: string, resource: Resource): Observable { @@ -138,10 +138,10 @@ export class BackupsService { const url = this.apiUrl.buildUrl(link.href); return this.http.request(link.method, url).pipe( - tap(() => { - this.analytics.trackEvent('Backup', 'Deleted', appName); - }), - pretifyError('Failed to delete backup.')); + tap(() => { + this.analytics.trackEvent('Backup', 'Deleted', appName); + }), + pretifyError('Failed to delete backup.')); } } diff --git a/src/Squidex/app/shared/services/clients.service.ts b/src/Squidex/app/shared/services/clients.service.ts index 8bb895877..39a0473c2 100644 --- a/src/Squidex/app/shared/services/clients.service.ts +++ b/src/Squidex/app/shared/services/clients.service.ts @@ -80,23 +80,23 @@ export class ClientsService { const url = this.apiUrl.buildUrl(`api/apps/${appName}/clients`); return HTTP.getVersioned(this.http, url).pipe( - mapVersioned(({ body }) => { - return parseClients(body); - }), - pretifyError('Failed to load clients. Please reload.')); + mapVersioned(({ body }) => { + return parseClients(body); + }), + pretifyError('Failed to load clients. Please reload.')); } public postClient(appName: string, dto: CreateClientDto, version: Version): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/clients`); return HTTP.postVersioned(this.http, url, dto, version).pipe( - mapVersioned(({ body }) => { - return parseClients(body); - }), - tap(() => { - this.analytics.trackEvent('Client', 'Created', appName); - }), - pretifyError('Failed to add client. Please reload.')); + mapVersioned(({ body }) => { + return parseClients(body); + }), + tap(() => { + this.analytics.trackEvent('Client', 'Created', appName); + }), + pretifyError('Failed to add client. Please reload.')); } public putClient(appName: string, resource: Resource, dto: UpdateClientDto, version: Version): Observable { @@ -105,13 +105,13 @@ export class ClientsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version, dto).pipe( - mapVersioned(({ body }) => { - return parseClients(body); - }), - tap(() => { - this.analytics.trackEvent('Client', 'Updated', appName); - }), - pretifyError('Failed to revoke client. Please reload.')); + mapVersioned(({ body }) => { + return parseClients(body); + }), + tap(() => { + this.analytics.trackEvent('Client', 'Updated', appName); + }), + pretifyError('Failed to revoke client. Please reload.')); } public deleteClient(appName: string, resource: Resource, version: Version): Observable { @@ -120,13 +120,13 @@ export class ClientsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version).pipe( - mapVersioned(({ body }) => { - return parseClients(body); - }), - tap(() => { - this.analytics.trackEvent('Client', 'Deleted', appName); - }), - pretifyError('Failed to revoke client. Please reload.')); + mapVersioned(({ body }) => { + return parseClients(body); + }), + tap(() => { + this.analytics.trackEvent('Client', 'Deleted', appName); + }), + pretifyError('Failed to revoke client. Please reload.')); } public createToken(appName: string, client: ClientDto): Observable { @@ -141,10 +141,10 @@ export class ClientsService { const url = this.apiUrl.buildUrl('identity-server/connect/token'); return this.http.post(url, body, options).pipe( - map((response: any) => { - return new AccessTokenDto(response.access_token, response.token_type); - }), - pretifyError('Failed to create token. Please retry.')); + map((response: any) => { + return new AccessTokenDto(response.access_token, response.token_type); + }), + pretifyError('Failed to create token. Please retry.')); } } diff --git a/src/Squidex/app/shared/services/comments.service.ts b/src/Squidex/app/shared/services/comments.service.ts index 36694e8da..6fb4d4ba5 100644 --- a/src/Squidex/app/shared/services/comments.service.ts +++ b/src/Squidex/app/shared/services/comments.service.ts @@ -56,58 +56,58 @@ export class CommentsService { const url = this.apiUrl.buildUrl(`api/apps/${appName}/comments/${commentsId}?version=${version.value}`); return this.http.get(url).pipe( - map(body => { - const comments = new CommentsDto( - body.createdComments.map((item: any) => { - return new CommentDto( - item.id, - DateTime.parseISO_UTC(item.time), - item.text, - item.user); - }), - body.updatedComments.map((item: any) => { - return new CommentDto( - item.id, - DateTime.parseISO_UTC(item.time), - item.text, - item.user); - }), - body.deletedComments, - new Version(body.version) - ); - - return comments; - }), - pretifyError('Failed to load comments.')); + map(body => { + const comments = new CommentsDto( + body.createdComments.map((item: any) => { + return new CommentDto( + item.id, + DateTime.parseISO_UTC(item.time), + item.text, + item.user); + }), + body.updatedComments.map((item: any) => { + return new CommentDto( + item.id, + DateTime.parseISO_UTC(item.time), + item.text, + item.user); + }), + body.deletedComments, + new Version(body.version) + ); + + return comments; + }), + pretifyError('Failed to load comments.')); } public postComment(appName: string, commentsId: string, dto: UpsertCommentDto): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/comments/${commentsId}`); return this.http.post(url, dto).pipe( - map(body => { - const comment = new CommentDto( - body.id, - DateTime.parseISO_UTC(body.time), - body.text, - body.user); - - return comment; - }), - pretifyError('Failed to create comment.')); + map(body => { + const comment = new CommentDto( + body.id, + DateTime.parseISO_UTC(body.time), + body.text, + body.user); + + return comment; + }), + pretifyError('Failed to create comment.')); } public putComment(appName: string, commentsId: string, commentId: string, dto: UpsertCommentDto): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/comments/${commentsId}/${commentId}`); return this.http.put(url, dto).pipe( - pretifyError('Failed to update comment.')); + pretifyError('Failed to update comment.')); } public deleteComment(appName: string, commentsId: string, commentId: string): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/comments/${commentsId}/${commentId}`); return this.http.delete(url).pipe( - pretifyError('Failed to delete comment.')); + pretifyError('Failed to delete comment.')); } } \ No newline at end of file diff --git a/src/Squidex/app/shared/services/contents.service.ts b/src/Squidex/app/shared/services/contents.service.ts index bed10aeca..1096e3679 100644 --- a/src/Squidex/app/shared/services/contents.service.ts +++ b/src/Squidex/app/shared/services/contents.service.ts @@ -137,45 +137,45 @@ export class ContentsService { const url = this.apiUrl.buildUrl(`/api/content/${appName}/${schemaName}?${fullQuery}`); return this.http.get<{ total: number, items: [], statuses: StatusInfo[] } & Resource>(url).pipe( - map(({ total, items, statuses, _links }) => { - const contents = items.map(x => parseContent(x)); + map(({ total, items, statuses, _links }) => { + const contents = items.map(x => parseContent(x)); - return new ContentsDto(statuses, total, contents, _links); - }), - pretifyError('Failed to load contents. Please reload.')); + return new ContentsDto(statuses, total, contents, _links); + }), + pretifyError('Failed to load contents. Please reload.')); } public getContent(appName: string, schemaName: string, id: string): Observable { const url = this.apiUrl.buildUrl(`/api/content/${appName}/${schemaName}/${id}`); return HTTP.getVersioned(this.http, url).pipe( - map(({ payload }) => { - return parseContent(payload.body); - }), - pretifyError('Failed to load content. Please reload.')); + map(({ payload }) => { + return parseContent(payload.body); + }), + pretifyError('Failed to load content. Please reload.')); } public getVersionData(appName: string, schemaName: string, id: string, version: Version): Observable> { const url = this.apiUrl.buildUrl(`/api/content/${appName}/${schemaName}/${id}/${version.value}`); return HTTP.getVersioned(this.http, url).pipe( - mapVersioned(({ body }) => { - return body; - }), - pretifyError('Failed to load data. Please reload.')); + mapVersioned(({ body }) => { + return body; + }), + pretifyError('Failed to load data. Please reload.')); } public postContent(appName: string, schemaName: string, dto: any, publish: boolean): Observable { const url = this.apiUrl.buildUrl(`/api/content/${appName}/${schemaName}?publish=${publish}`); return HTTP.postVersioned(this.http, url, dto).pipe( - map(({ payload }) => { - return parseContent(payload.body); - }), - tap(() => { - this.analytics.trackEvent('Content', 'Created', appName); - }), - pretifyError('Failed to create content. Please reload.')); + map(({ payload }) => { + return parseContent(payload.body); + }), + tap(() => { + this.analytics.trackEvent('Content', 'Created', appName); + }), + pretifyError('Failed to create content. Please reload.')); } public putContent(appName: string, resource: Resource, dto: any, version: Version): Observable { @@ -184,13 +184,13 @@ export class ContentsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.putVersioned(this.http, url, dto, version).pipe( - map(({ payload }) => { - return parseContent(payload.body); - }), - tap(() => { - this.analytics.trackEvent('Content', 'Updated', appName); - }), - pretifyError('Failed to update content. Please reload.')); + map(({ payload }) => { + return parseContent(payload.body); + }), + tap(() => { + this.analytics.trackEvent('Content', 'Updated', appName); + }), + pretifyError('Failed to update content. Please reload.')); } public patchContent(appName: string, resource: Resource, dto: any, version: Version): Observable { @@ -199,13 +199,13 @@ export class ContentsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version, dto).pipe( - map(({ payload }) => { - return parseContent(payload.body); - }), - tap(() => { - this.analytics.trackEvent('Content', 'Updated', appName); - }), - pretifyError('Failed to update content. Please reload.')); + map(({ payload }) => { + return parseContent(payload.body); + }), + tap(() => { + this.analytics.trackEvent('Content', 'Updated', appName); + }), + pretifyError('Failed to update content. Please reload.')); } public discardDraft(appName: string, resource: Resource, version: Version): Observable { @@ -214,13 +214,13 @@ export class ContentsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version, {}).pipe( - map(({ payload }) => { - return parseContent(payload.body); - }), - tap(() => { - this.analytics.trackEvent('Content', 'Discarded', appName); - }), - pretifyError('Failed to discard draft. Please reload.')); + map(({ payload }) => { + return parseContent(payload.body); + }), + tap(() => { + this.analytics.trackEvent('Content', 'Discarded', appName); + }), + pretifyError('Failed to discard draft. Please reload.')); } public proposeDraft(appName: string, resource: Resource, dto: any, version: Version): Observable { @@ -229,13 +229,13 @@ export class ContentsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.putVersioned(this.http, url, dto, version).pipe( - map(({ payload }) => { - return parseContent(payload.body); - }), - tap(() => { - this.analytics.trackEvent('Content', 'Updated', appName); - }), - pretifyError('Failed to propose draft. Please reload.')); + map(({ payload }) => { + return parseContent(payload.body); + }), + tap(() => { + this.analytics.trackEvent('Content', 'Updated', appName); + }), + pretifyError('Failed to propose draft. Please reload.')); } public publishDraft(appName: string, resource: Resource, dueTime: string | null, version: Version): Observable { @@ -244,13 +244,13 @@ export class ContentsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version, { status: 'Published', dueTime }).pipe( - map(({ payload }) => { - return parseContent(payload.body); - }), - tap(() => { - this.analytics.trackEvent('Content', 'Discarded', appName); - }), - pretifyError('Failed to publish draft. Please reload.')); + map(({ payload }) => { + return parseContent(payload.body); + }), + tap(() => { + this.analytics.trackEvent('Content', 'Discarded', appName); + }), + pretifyError('Failed to publish draft. Please reload.')); } public putStatus(appName: string, resource: Resource, status: string, dueTime: string | null, version: Version): Observable { @@ -259,13 +259,13 @@ export class ContentsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version, { status, dueTime }).pipe( - map(({ payload }) => { - return parseContent(payload.body); - }), - tap(() => { - this.analytics.trackEvent('Content', 'Archived', appName); - }), - pretifyError(`Failed to ${status} content. Please reload.`)); + map(({ payload }) => { + return parseContent(payload.body); + }), + tap(() => { + this.analytics.trackEvent('Content', 'Archived', appName); + }), + pretifyError(`Failed to ${status} content. Please reload.`)); } public deleteContent(appName: string, resource: Resource, version: Version): Observable> { @@ -274,10 +274,10 @@ export class ContentsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version).pipe( - tap(() => { - this.analytics.trackEvent('Content', 'Deleted', appName); - }), - pretifyError('Failed to delete content. Please reload.')); + tap(() => { + this.analytics.trackEvent('Content', 'Deleted', appName); + }), + pretifyError('Failed to delete content. Please reload.')); } } diff --git a/src/Squidex/app/shared/services/contributors.service.ts b/src/Squidex/app/shared/services/contributors.service.ts index def17609a..452116a9b 100644 --- a/src/Squidex/app/shared/services/contributors.service.ts +++ b/src/Squidex/app/shared/services/contributors.service.ts @@ -50,7 +50,7 @@ export class ContributorDto { } } -export interface AssignContributorDto { +export interface AssignContributorDto { readonly contributorId: string; readonly role: string; readonly invite?: boolean; @@ -69,23 +69,23 @@ export class ContributorsService { const url = this.apiUrl.buildUrl(`api/apps/${appName}/contributors`); return HTTP.getVersioned(this.http, url).pipe( - mapVersioned(({ body }) => { - return parseContributors(body); - }), - pretifyError('Failed to load contributors. Please reload.')); + mapVersioned(({ body }) => { + return parseContributors(body); + }), + pretifyError('Failed to load contributors. Please reload.')); } public postContributor(appName: string, dto: AssignContributorDto, version: Version): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/contributors`); return HTTP.postVersioned(this.http, url, dto, version).pipe( - mapVersioned(({ body }) => { - return parseContributors(body); - }), - tap(() => { - this.analytics.trackEvent('Contributor', 'Configured', appName); - }), - pretifyError('Failed to add contributors. Please reload.')); + mapVersioned(({ body }) => { + return parseContributors(body); + }), + tap(() => { + this.analytics.trackEvent('Contributor', 'Configured', appName); + }), + pretifyError('Failed to add contributors. Please reload.')); } public deleteContributor(appName: string, resource: Resource, version: Version): Observable { @@ -94,15 +94,15 @@ export class ContributorsService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version).pipe( - mapVersioned(payload => { - const body = payload.body; - - return parseContributors(body); - }), - tap(() => { - this.analytics.trackEvent('Contributor', 'Deleted', appName); - }), - pretifyError('Failed to delete contributors. Please reload.')); + mapVersioned(payload => { + const body = payload.body; + + return parseContributors(body); + }), + tap(() => { + this.analytics.trackEvent('Contributor', 'Deleted', appName); + }), + pretifyError('Failed to delete contributors. Please reload.')); } } diff --git a/src/Squidex/app/shared/services/help.service.ts b/src/Squidex/app/shared/services/help.service.ts index b37528fd7..7abb21adf 100644 --- a/src/Squidex/app/shared/services/help.service.ts +++ b/src/Squidex/app/shared/services/help.service.ts @@ -21,6 +21,6 @@ export class HelpService { const url = `https://raw.githubusercontent.com/Squidex/squidex-docs/master/${helpPage}.md`; return this.http.get(url, { responseType: 'text' }).pipe( - catchError(() => of(''))); + catchError(() => of(''))); } } \ No newline at end of file diff --git a/src/Squidex/app/shared/services/history.service.ts b/src/Squidex/app/shared/services/history.service.ts index d79add475..95fef8ede 100644 --- a/src/Squidex/app/shared/services/history.service.ts +++ b/src/Squidex/app/shared/services/history.service.ts @@ -82,17 +82,17 @@ export class HistoryService { const url = this.apiUrl.buildUrl(`api/apps/${appName}/history?channel=${channel}`); return this.http.get(url).pipe( - map(body => { - const history = body.map(item => - new HistoryEventDto( - item.eventId, - item.actor, - item.message, - item.version, - DateTime.parseISO_UTC(item.created))); - - return history; - }), - pretifyError('Failed to load history. Please reload.')); + map(body => { + const history = body.map(item => + new HistoryEventDto( + item.eventId, + item.actor, + item.message, + item.version, + DateTime.parseISO_UTC(item.created))); + + return history; + }), + pretifyError('Failed to load history. Please reload.')); } } \ No newline at end of file diff --git a/src/Squidex/app/shared/services/languages.service.ts b/src/Squidex/app/shared/services/languages.service.ts index ea76d2936..d905f63e2 100644 --- a/src/Squidex/app/shared/services/languages.service.ts +++ b/src/Squidex/app/shared/services/languages.service.ts @@ -32,14 +32,14 @@ export class LanguagesService { const url = this.apiUrl.buildUrl('api/languages'); return this.http.get(url).pipe( - map(body => { - const languages = body.map(item => - new LanguageDto( - item.iso2Code, - item.englishName)); + map(body => { + const languages = body.map(item => + new LanguageDto( + item.iso2Code, + item.englishName)); - return languages; - }), - pretifyError('Failed to load languages. Please reload.')); + return languages; + }), + pretifyError('Failed to load languages. Please reload.')); } } \ No newline at end of file diff --git a/src/Squidex/app/shared/services/news.service.ts b/src/Squidex/app/shared/services/news.service.ts index db7e02a5f..2c3be90fc 100644 --- a/src/Squidex/app/shared/services/news.service.ts +++ b/src/Squidex/app/shared/services/news.service.ts @@ -40,19 +40,19 @@ export class NewsService { const url = this.apiUrl.buildUrl(`api/news/features?version=${version}`); return this.http.get(url).pipe( - map(body => { - const items: any[] = body.features; - - const features = new FeaturesDto( - items.map(item => - new FeatureDto( - item.name, - item.text) - ), - body.version); - - return features; - }), - pretifyError('Failed to load features. Please reload.')); + map(body => { + const items: any[] = body.features; + + const features = new FeaturesDto( + items.map(item => + new FeatureDto( + item.name, + item.text) + ), + body.version); + + return features; + }), + pretifyError('Failed to load features. Please reload.')); } } \ No newline at end of file diff --git a/src/Squidex/app/shared/services/plans.service.ts b/src/Squidex/app/shared/services/plans.service.ts index 31e1ace9a..6410cc22a 100644 --- a/src/Squidex/app/shared/services/plans.service.ts +++ b/src/Squidex/app/shared/services/plans.service.ts @@ -62,42 +62,42 @@ export class PlansService { const url = this.apiUrl.buildUrl(`api/apps/${appName}/plans`); return HTTP.getVersioned(this.http, url).pipe( - mapVersioned(({ body }) => { - const items: any[] = body.plans; + mapVersioned(({ body }) => { + const items: any[] = body.plans; - const { hasPortal, currentPlanId, planOwner } = body; + const { hasPortal, currentPlanId, planOwner } = body; - const plans = { - currentPlanId, - planOwner, - plans: items.map(item => - new PlanDto( - item.id, - item.name, - item.costs, - item.yearlyId, - item.yearlyCosts, - item.maxApiCalls, - item.maxAssetSize, - item.maxContributors)), - hasPortal - }; + const plans = { + currentPlanId, + planOwner, + plans: items.map(item => + new PlanDto( + item.id, + item.name, + item.costs, + item.yearlyId, + item.yearlyCosts, + item.maxApiCalls, + item.maxAssetSize, + item.maxContributors)), + hasPortal + }; - return plans; - }), - pretifyError('Failed to load plans. Please reload.')); + return plans; + }), + pretifyError('Failed to load plans. Please reload.')); } public putPlan(appName: string, dto: ChangePlanDto, version: Version): Observable> { const url = this.apiUrl.buildUrl(`api/apps/${appName}/plan`); return HTTP.putVersioned(this.http, url, dto, version).pipe( - mapVersioned(payload => { - return payload.body; - }), - tap(() => { - this.analytics.trackEvent('Plan', 'Changed', appName); - }), - pretifyError('Failed to change plan. Please reload.')); + mapVersioned(payload => { + return payload.body; + }), + tap(() => { + this.analytics.trackEvent('Plan', 'Changed', appName); + }), + pretifyError('Failed to change plan. Please reload.')); } } \ No newline at end of file diff --git a/src/Squidex/app/shared/services/roles.service.ts b/src/Squidex/app/shared/services/roles.service.ts index 7fa11d194..bc5a72154 100644 --- a/src/Squidex/app/shared/services/roles.service.ts +++ b/src/Squidex/app/shared/services/roles.service.ts @@ -72,23 +72,23 @@ export class RolesService { const url = this.apiUrl.buildUrl(`api/apps/${appName}/roles`); return HTTP.getVersioned(this.http, url).pipe( - mapVersioned(({ body }) => { - return parseRoles(body); - }), - pretifyError('Failed to load roles. Please reload.')); + mapVersioned(({ body }) => { + return parseRoles(body); + }), + pretifyError('Failed to load roles. Please reload.')); } public postRole(appName: string, dto: CreateRoleDto, version: Version): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/roles`); return HTTP.postVersioned(this.http, url, dto, version).pipe( - mapVersioned(({ body }) => { - return parseRoles(body); - }), - tap(() => { - this.analytics.trackEvent('Role', 'Created', appName); - }), - pretifyError('Failed to add role. Please reload.')); + mapVersioned(({ body }) => { + return parseRoles(body); + }), + tap(() => { + this.analytics.trackEvent('Role', 'Created', appName); + }), + pretifyError('Failed to add role. Please reload.')); } public putRole(appName: string, resource: Resource, dto: UpdateRoleDto, version: Version): Observable { @@ -97,13 +97,13 @@ export class RolesService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version, dto).pipe( - mapVersioned(({ body }) => { - return parseRoles(body); - }), - tap(() => { - this.analytics.trackEvent('Role', 'Updated', appName); - }), - pretifyError('Failed to revoke role. Please reload.')); + mapVersioned(({ body }) => { + return parseRoles(body); + }), + tap(() => { + this.analytics.trackEvent('Role', 'Updated', appName); + }), + pretifyError('Failed to revoke role. Please reload.')); } public deleteRole(appName: string, resource: Resource, version: Version): Observable { @@ -112,20 +112,20 @@ export class RolesService { const url = this.apiUrl.buildUrl(link.href); return HTTP.requestVersioned(this.http, link.method, url, version).pipe( - mapVersioned(({ body }) => { - return parseRoles(body); - }), - tap(() => { - this.analytics.trackEvent('Role', 'Deleted', appName); - }), - pretifyError('Failed to revoke role. Please reload.')); + mapVersioned(({ body }) => { + return parseRoles(body); + }), + tap(() => { + this.analytics.trackEvent('Role', 'Deleted', appName); + }), + pretifyError('Failed to revoke role. Please reload.')); } public getPermissions(appName: string): Observable { const url = this.apiUrl.buildUrl(`api/apps/${appName}/roles/permissions`); return this.http.get(url).pipe( - pretifyError('Failed to load permissions. Please reload.')); + pretifyError('Failed to load permissions. Please reload.')); } } diff --git a/src/Squidex/app/shared/services/rules.service.ts b/src/Squidex/app/shared/services/rules.service.ts index 5c42f7dec..b4f6c8350 100644 --- a/src/Squidex/app/shared/services/rules.service.ts +++ b/src/Squidex/app/shared/services/rules.service.ts @@ -41,7 +41,8 @@ export const ALL_TRIGGERS = { description: 'When a schema definition has been created, updated, published or deleted...', display: 'Schema changed', iconColor: '#3389ff', - iconCode: 'schemas'}, + iconCode: 'schemas' + }, 'Usage': { description: 'When monthly API calls exceed a specified limit for one time a month...', display: 'Usage exceeded', diff --git a/src/Squidex/app/shared/services/translations.service.ts b/src/Squidex/app/shared/services/translations.service.ts index b5b91897d..30d8ee52b 100644 --- a/src/Squidex/app/shared/services/translations.service.ts +++ b/src/Squidex/app/shared/services/translations.service.ts @@ -38,9 +38,9 @@ export class TranslationsService { const url = this.apiUrl.buildUrl(`api/apps/${appName}/translations`); return this.http.post(url, request).pipe( - map(body => { - return new TranslationDto(body.result, body.text); - }), - pretifyError('Failed to translate text. Please reload.')); + map(body => { + return new TranslationDto(body.result, body.text); + }), + pretifyError('Failed to translate text. Please reload.')); } } \ No newline at end of file diff --git a/src/Squidex/app/shared/services/usages.service.ts b/src/Squidex/app/shared/services/usages.service.ts index dbd004aae..e97b99106 100644 --- a/src/Squidex/app/shared/services/usages.service.ts +++ b/src/Squidex/app/shared/services/usages.service.ts @@ -72,55 +72,55 @@ export class UsagesService { const url = this.apiUrl.buildUrl(`api/apps/${app}/usages/calls/month`); return this.http.get(url).pipe( - map(body => { - return new CurrentCallsDto(body.count, body.maxAllowed); - }), - pretifyError('Failed to load monthly api calls. Please reload.')); + map(body => { + return new CurrentCallsDto(body.count, body.maxAllowed); + }), + pretifyError('Failed to load monthly api calls. Please reload.')); } public getTodayStorage(app: string): Observable { const url = this.apiUrl.buildUrl(`api/apps/${app}/usages/storage/today`); return this.http.get(url).pipe( - map(body => { - return new CurrentStorageDto(body.size, body.maxAllowed); - }), - pretifyError('Failed to load todays storage size. Please reload.')); + map(body => { + return new CurrentStorageDto(body.size, body.maxAllowed); + }), + pretifyError('Failed to load todays storage size. Please reload.')); } public getCallsUsages(app: string, fromDate: DateTime, toDate: DateTime): Observable<{ [category: string]: CallsUsageDto[] }> { const url = this.apiUrl.buildUrl(`api/apps/${app}/usages/calls/${fromDate.toUTCStringFormat('YYYY-MM-DD')}/${toDate.toUTCStringFormat('YYYY-MM-DD')}`); return this.http.get(url).pipe( - map(body => { - const usages: { [category: string]: CallsUsageDto[] } = {}; - - for (let category of Object.keys(body)) { - usages[category] = body[category].map((item: any) => - new CallsUsageDto( - DateTime.parseISO_UTC(item.date), - item.count, - item.averageMs)); - } - - return usages; - }), - pretifyError('Failed to load calls usage. Please reload.')); + map(body => { + const usages: { [category: string]: CallsUsageDto[] } = {}; + + for (let category of Object.keys(body)) { + usages[category] = body[category].map((item: any) => + new CallsUsageDto( + DateTime.parseISO_UTC(item.date), + item.count, + item.averageMs)); + } + + return usages; + }), + pretifyError('Failed to load calls usage. Please reload.')); } public getStorageUsages(app: string, fromDate: DateTime, toDate: DateTime): Observable { const url = this.apiUrl.buildUrl(`api/apps/${app}/usages/storage/${fromDate.toUTCStringFormat('YYYY-MM-DD')}/${toDate.toUTCStringFormat('YYYY-MM-DD')}`); return this.http.get(url).pipe( - map(body => { - const usages = body.map(item => - new StorageUsageDto( - DateTime.parseISO_UTC(item.date), - item.count, - item.size)); + map(body => { + const usages = body.map(item => + new StorageUsageDto( + DateTime.parseISO_UTC(item.date), + item.count, + item.size)); - return usages; - }), - pretifyError('Failed to load storage usage. Please reload.')); + return usages; + }), + pretifyError('Failed to load storage usage. Please reload.')); } } \ No newline at end of file diff --git a/src/Squidex/app/shared/services/users.service.ts b/src/Squidex/app/shared/services/users.service.ts index 6f4d4c1da..7c245db05 100644 --- a/src/Squidex/app/shared/services/users.service.ts +++ b/src/Squidex/app/shared/services/users.service.ts @@ -44,38 +44,38 @@ export class UsersService { const url = this.apiUrl.buildUrl(`api/users?query=${query || ''}`); return this.http.get(url).pipe( - map(body => { - const users = body.map(item => - new UserDto( - item.id, - item.displayName)); + map(body => { + const users = body.map(item => + new UserDto( + item.id, + item.displayName)); - return users; - }), - pretifyError('Failed to load users. Please reload.')); + return users; + }), + pretifyError('Failed to load users. Please reload.')); } public getUser(id: string): Observable { const url = this.apiUrl.buildUrl(`api/users/${id}`); return this.http.get(url).pipe( - map(body => { - const user = new UserDto( - body.id, - body.displayName); + map(body => { + const user = new UserDto( + body.id, + body.displayName); - return user; - }), - pretifyError('Failed to load user. Please reload.')); + return user; + }), + pretifyError('Failed to load user. Please reload.')); } public getResources(): Observable { const url = this.apiUrl.buildUrl(`api`); return this.http.get<{ _links: {} }>(url).pipe( - map(({ _links }) => { - return new ResourcesDto(_links); - }), - pretifyError('Failed to load user. Please reload.')); + map(({ _links }) => { + return new ResourcesDto(_links); + }), + pretifyError('Failed to load user. Please reload.')); } } \ No newline at end of file