Skip to content

Commit

Permalink
🔊 update page number error message and remove slugs log
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Fernandez <[email protected]>
  • Loading branch information
AlbertoFdzM committed Nov 25, 2023
1 parent 5b1b2d8 commit 82c7380
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
run: |
touch .env
echo NEXT_PUBLIC_BASE_URL=${{ secrets.NEXT_PUBLIC_BASE_URL }} >> .env
echo NEXT_PUBLIC_COPYRIGHT=${{ secrets.NEXT_PUBLIC_COPYRIGHT }} >> .env
echo NEXT_PUBLIC_DISQUS_SHORTNAME=${{ secrets.NEXT_PUBLIC_DISQUS_SHORTNAME }} >> .env
echo NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID }} >> .env
echo NEXT_PUBLIC_POSTS_PER_PAGE=${{ secrets.NEXT_PUBLIC_POSTS_PER_PAGE }} >> .env
Expand Down
4 changes: 3 additions & 1 deletion src/Posts/application/ListPostsUseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export class ListPostsUseCase implements UseCase<Input, PaginatedList<Post>> {
const totalPages: number = await this.postsRepository.getTotalPages(locale);

if (page > totalPages || page < MINIMUM_PAGE) {
throw new Error(`Invalid page number ${page}`);
throw new Error(
`Invalid page number: ${page} (totalPages: ${totalPages})`,
);
}

const postPaths: string[] =
Expand Down
2 changes: 1 addition & 1 deletion src/Posts/domain/PostsRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class PostsRepository {
.replace(/\w*\//, "")
.replace(/(?:\/index)?\.md$/, "");

console.log(`${postPath.replace(postsDirectoryPath, "")} -> ${slug}`);
// console.log(`${postPath.replace(postsDirectoryPath, "")} -> ${slug}`);

return slug;
}
Expand Down

0 comments on commit 82c7380

Please sign in to comment.