lint code

Signed-off-by: Arthur DANJOU <arthurdanjou@outlook.fr>
This commit is contained in:
2024-04-20 01:12:41 +02:00
parent c698bfec8a
commit 4574a7dccd
69 changed files with 3110 additions and 3013 deletions

View File

@@ -1,20 +1,20 @@
export default defineEventHandler(async (event) => {
const { favorite, category } = getQuery(event)
const { favorite, category } = getQuery(event)
const bookmarks = await useDB().query.bookmarks
.findMany({
orderBy: [asc(tables.talents.id)],
with: {
bookmarkCategories: {
with: {
category: true,
},
},
},
})
const bookmarks = await useDB().query.bookmarks
.findMany({
orderBy: [asc(tables.talents.id)],
with: {
bookmarkCategories: {
with: {
category: true,
},
},
},
})
return bookmarks.filter(bookmark =>
(category === 'all' || bookmark.bookmarkCategories.some(cat => cat.category.slug === category))
&& (favorite === 'false' || bookmark.favorite),
)
return bookmarks.filter(bookmark =>
(category === 'all' || bookmark.bookmarkCategories.some(cat => cat.category.slug === category))
&& (favorite === 'false' || bookmark.favorite),
)
})