chore: schemas, styles, cleanup

This commit is contained in:
Cory Dransfeldt 2024-10-14 16:43:11 -07:00
parent e0c0c5ccd2
commit 7caf3370ff
No known key found for this signature in database
17 changed files with 123 additions and 55 deletions

View file

@ -1,11 +1,10 @@
export default {
bookStatus: (books, status) => books.filter(book => book['status'] === status),
bookFavorites: (books) => books.filter(book => book.favorite === true),
filterBooksByStatus: (books, status) => books.filter(book => book['status'] === status),
findFavoriteBooks: (books) => books.filter(book => book['favorite'] === true),
bookYearLinks: (years) => years
.sort((a, b) => b.value - a.value)
.map((year, index) => `<a href="/books/years/${year.value}">${year.value}</a>${index < years.length - 1 ? ' / ' : ''}`)
.sort((a, b) => b['value'] - a['value'])
.map((year, index) => `<a href="/books/years/${year['value']}">${year['value']}</a>${index < years.length - 1 ? ' / ' : ''}`)
.join(''),
bookFinishedYear: (books, year) => books.filter(book => book.status === 'finished' && parseInt(book.year) === parseInt(year)),
mediaLinks: (data, type, count = 10) => {
if (!data || !type) return ''