Fix outdated error message in paginate() function (#6124)

* Update paginate.ts

* Create gorgeous-mails-sniff.md
This commit is contained in:
Fred K. Schott 2023-02-03 15:34:09 -08:00 committed by GitHub
parent 4f150e80b1
commit f20a85b642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
Fix outdated error message in `paginate()` function.

View file

@ -24,7 +24,7 @@ export function generatePaginateFunction(routeMatch: RouteData): PaginateFunctio
includesFirstPageNumber = true;
} else {
throw new Error(
`[paginate()] page number param \`${paramName}\` not found in your filepath.\nRename your file to \`[...page].astro\` or customize the param name via the \`paginate([], {param: '...'}\` option.`
`[paginate()] page number param \`${paramName}\` not found in your filepath.\nRename your file to \`[page].astro\` or \`[...page].astro\`.`
);
}
const lastPage = Math.max(1, Math.ceil(data.length / pageSize));