diff --git a/src/comic-issue/comic-issue.controller.ts b/src/comic-issue/comic-issue.controller.ts index d3ff062b..decaf6a2 100644 --- a/src/comic-issue/comic-issue.controller.ts +++ b/src/comic-issue/comic-issue.controller.ts @@ -186,6 +186,12 @@ export class ComicIssueController { return toComicPageDtoArray(pages); } + @Get('get/:id/preview-pages') + async getPreviewPages(@Param('id') id: string): Promise { + const pages = await this.comicIssueService.getPreviewPages(+id); + return toComicPageDtoArray(pages); + } + /* Update specific comic issue */ @ComicIssueOwnerAuth() @Patch('update/:id') diff --git a/src/comic-issue/comic-issue.service.ts b/src/comic-issue/comic-issue.service.ts index 8eb7399f..42e3b80b 100644 --- a/src/comic-issue/comic-issue.service.ts +++ b/src/comic-issue/comic-issue.service.ts @@ -409,6 +409,11 @@ export class ComicIssueService { return pages; } + async getPreviewPages(comicIssueId: number) { + const pages = await this.comicPageService.findAll(comicIssueId, true); + return pages; + } + async update(id: number, updateComicIssueDto: UpdateComicIssueDto) { await this.throwIfComicIsPublishedOnChain(id);