Spaces:
Paused
Paused
Update handlers/search-catalog.js
Browse files2 unmodified lines345678910111012121314151617181920202122232425262 unmodified lines
return async (args) => { try { // Validate the content type validateContentType(args)
// Perform the search using searchCatalog const items = await searchCatalog({ search: args.extra.search,
genre: args.extra.genre,
skip: args.extra.skip, })
// Return the catalog in the required format return { metas: items.map(toCatalog), } } catch (error) { return new Promise.resolve({ metas: [] }) // Handle any errors gracefully console.error("Error in search-catalog handler:", error) return { metas: [] } } }}handlers/search-catalog.js+6-3