diff --git a/src/routes/api/entries.json.ts b/src/routes/api/entries.json.ts index 23fea4cd..7f9d96e6 100644 --- a/src/routes/api/entries.json.ts +++ b/src/routes/api/entries.json.ts @@ -10,7 +10,7 @@ export const get: RequestHandler = async req => { const showVisible = req.url.searchParams.get('visible') !== 'false' const showUnlisted = req.url.searchParams.get('unlisted') === 'true' const showHidden = req.url.searchParams.get('hidden') === 'true' - const tags = req.url.searchParams.get('tags')?.split(',') + const tags = req.url.searchParams.get('tags')?.split(',')?.map(tag => tag.trim())?.filter(tag => tag.length > 0) const query = req.url.searchParams.get('query') const user = req.locals.user ? await fetchUser({ id: req.locals.user.id }) : null