diff --git a/apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.ts b/apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.ts index 668d41a49..44210fa44 100644 --- a/apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.ts +++ b/apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.ts @@ -67,9 +67,9 @@ export class PageIndicatorComponent implements OnChanges { private _markPageUnread() { this._viewedPagesControllerService .removePage( - { page: this.number }, this._appStateService.activeProjectId, - this._appStateService.activeFileId + this._appStateService.activeFileId, + this.number ) .subscribe(() => { this.viewedPages?.pages?.splice(this.viewedPages?.pages?.indexOf(this.number), 1); diff --git a/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts b/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts index 46b0f1a39..9691491d1 100644 --- a/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts +++ b/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts @@ -236,46 +236,40 @@ export class ViewedPagesControllerService { /** * Removes a page to the viewed pages * None - * @param body viewedPagesRequest * @param projectId projectId * @param fileId fileId + * @param page page * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public removePage( - body: ViewedPagesRequest, projectId: string, fileId: string, + page: number, observe?: 'body', reportProgress?: boolean ): Observable; public removePage( - body: ViewedPagesRequest, projectId: string, fileId: string, + page: number, observe?: 'response', reportProgress?: boolean ): Observable>; public removePage( - body: ViewedPagesRequest, projectId: string, fileId: string, + page: number, observe?: 'events', reportProgress?: boolean ): Observable>; public removePage( - body: ViewedPagesRequest, projectId: string, fileId: string, + page: number, observe: any = 'body', reportProgress: boolean = false ): Observable { - if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling removePage.' - ); - } - if (projectId === null || projectId === undefined) { throw new Error( 'Required parameter projectId was null or undefined when calling removePage.' @@ -288,6 +282,12 @@ export class ViewedPagesControllerService { ); } + if (page === null || page === undefined) { + throw new Error( + 'Required parameter page was null or undefined when calling removePage.' + ); + } + let headers = this.defaultHeaders; // authentication (RED-OAUTH) required @@ -309,21 +309,14 @@ export class ViewedPagesControllerService { } // to determine the Content-Type header - const consumes: string[] = ['*/*']; - const httpContentTypeSelected: - | string - | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } + const consumes: string[] = []; return this.httpClient.request( 'delete', `${this.basePath}/viewedPages/${encodeURIComponent( String(projectId) - )}/${encodeURIComponent(String(fileId))}`, + )}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(String(page))}`, { - body: body, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe,