Error handling and TODO

This commit is contained in:
2025-01-12 22:33:53 -05:00
parent 0de96f7be0
commit a5fcffa344
4 changed files with 47 additions and 22 deletions

View File

@@ -69,9 +69,9 @@ export async function fetchBookChapterLinks(bookId: string): Promise<Book> {
*/
export async function fetchBookById(bookId: string): Promise<Book> {
const currentDateTime = new Date().toISOString();
const data = await fetchFromAPI<{ data: Book }>(
`/api/books/${bookId}?populate[chapters][filters][release_datetime][$lte]=${currentDateTime}&populate=cover`
);
const data = await fetchFromAPI<{ data: Book }>(
`/api/books/${bookId}?populate[chapters][filters][release_datetime][$lte]=${currentDateTime}&populate=cover`
);
return data.data;
}