Skip to content

Commit

Permalink
feat: get comic issue preview pages
Browse files Browse the repository at this point in the history
  • Loading branch information
athar-d-reader committed Sep 30, 2024
1 parent 8ff7540 commit 37d8ea1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/comic-issue/comic-issue.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ export class ComicIssueController {
return toComicPageDtoArray(pages);
}

@Get('get/:id/preview-pages')
async getPreviewPages(@Param('id') id: string): Promise<ComicPageDto[]> {
const pages = await this.comicIssueService.getPreviewPages(+id);
return toComicPageDtoArray(pages);
}

/* Update specific comic issue */
@ComicIssueOwnerAuth()
@Patch('update/:id')
Expand Down
5 changes: 5 additions & 0 deletions src/comic-issue/comic-issue.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 37d8ea1

Please sign in to comment.