Spaces:
Paused
Paused
Update handlers/search-catalog.js
Browse files
handlers/search-catalog.js
CHANGED
|
@@ -6,12 +6,15 @@ module.exports = (dependencies) => {
|
|
| 6 |
// Validate the content type
|
| 7 |
validateContentType(args)
|
| 8 |
|
| 9 |
-
//
|
| 10 |
-
const
|
| 11 |
search: args.extra.search,
|
| 12 |
genre: args.extra.genre,
|
| 13 |
skip: args.extra.skip,
|
| 14 |
-
}
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
// Return the catalog in the required format
|
| 17 |
return {
|
|
|
|
| 6 |
// Validate the content type
|
| 7 |
validateContentType(args)
|
| 8 |
|
| 9 |
+
// Adjust search query parameters and ensure we don't pass an invalid 'license'
|
| 10 |
+
const searchParams = {
|
| 11 |
search: args.extra.search,
|
| 12 |
genre: args.extra.genre,
|
| 13 |
skip: args.extra.skip,
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
// Perform the search using searchCatalog
|
| 17 |
+
const items = await searchCatalog(searchParams)
|
| 18 |
|
| 19 |
// Return the catalog in the required format
|
| 20 |
return {
|