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