fix: filter
This commit is contained in:
parent
1b89de2af7
commit
a5616be99c
1 changed files with 1 additions and 1 deletions
|
@ -48,7 +48,7 @@ export default async function () {
|
||||||
const books = await fetchAllBooks();
|
const books = await fetchAllBooks();
|
||||||
const sortedByYear = sortBooksByYear(books);
|
const sortedByYear = sortBooksByYear(books);
|
||||||
const booksForCurrentYear =
|
const booksForCurrentYear =
|
||||||
sortedByYear.find((yearGroup) => yearGroup.value === currentYear)?.data ||
|
sortedByYear.find((yearGroup) => yearGroup.value === currentYear)?.data.filter(book => book['status'] === 'finished') ||
|
||||||
[];
|
[];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Reference in a new issue