Skip to content

Commit c8e7084

Browse files
committed
fix lint
1 parent d9fadf2 commit c8e7084

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/frontend/pages/items/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function ItemsIndex({ items, pagy }: Props) {
1717
}
1818
}
1919

20-
const goToPage = (page: number) => {
20+
const goToPage = (page: number | null = 1) => {
2121
router.get(itemsPath(), { page }, { preserveState: true })
2222
}
2323

@@ -84,7 +84,7 @@ export default function ItemsIndex({ items, pagy }: Props) {
8484
<Button
8585
variant="outline"
8686
size="sm"
87-
onClick={() => goToPage(pagy.prev!)}
87+
onClick={() => goToPage(pagy?.prev)}
8888
disabled={!pagy.prev}
8989
>
9090
Previous
@@ -95,7 +95,7 @@ export default function ItemsIndex({ items, pagy }: Props) {
9595
<Button
9696
variant="outline"
9797
size="sm"
98-
onClick={() => goToPage(pagy.next!)}
98+
onClick={() => goToPage(pagy?.next)}
9999
disabled={!pagy.next}
100100
>
101101
Next

0 commit comments

Comments
 (0)