Skip to content

Commit 34f6353

Browse files
committed
Fixed breaking error when there was no rating
1 parent 4968c49 commit 34f6353

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/apis/OpenLibraryAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class OpenLibraryAPI extends APIModel {
7373

7474
author: result.author_name ?? 'unknown',
7575
pages: result.number_of_pages_median ?? 'unknown',
76-
onlineRating: Number.parseFloat(result.ratings_average.toFixed(2)) ?? 0,
76+
onlineRating: Number.parseFloat(Number(result.ratings_average ?? 0).toFixed(2)),
7777
image: `https://covers.openlibrary.org/b/OLID/` + result.cover_edition_key + `-L.jpg` ?? '',
7878

7979
released: true,

0 commit comments

Comments
 (0)