Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Commit 8703ad6

Browse files
futa-ikedaadlius
authored andcommitted
Handle case where links object is not there
1 parent 57a6790 commit 8703ad6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/models/index-card-search.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ export default class IndexCardSearchModel extends Model {
2323
relatedProperties!: RelatedPropertyPathModel[];
2424

2525
get firstPageCursor() {
26-
if (this.searchResultPage.links.first?.href) {
26+
if (this.searchResultPage.links?.first?.href) {
2727
const firstPageLinkUrl = new URL(this.searchResultPage.links.first?.href);
2828
return firstPageLinkUrl.searchParams.get('page[cursor]');
2929
}
3030
return null;
3131
}
3232

3333
get prevPageCursor() {
34-
if (this.searchResultPage.links.prev?.href) {
34+
if (this.searchResultPage.links?.prev?.href) {
3535
const prevPageLinkUrl = new URL(this.searchResultPage.links.prev?.href);
3636
return prevPageLinkUrl.searchParams.get('page[cursor]');
3737
}
3838
return null;
3939
}
4040

4141
get nextPageCursor() {
42-
if (this.searchResultPage.links.next?.href) {
42+
if (this.searchResultPage.links?.next?.href) {
4343
const nextPageLinkUrl = new URL(this.searchResultPage.links.next?.href);
4444
return nextPageLinkUrl.searchParams.get('page[cursor]');
4545
}

0 commit comments

Comments
 (0)