chore: fix OAS for product search endpoint (#4490)

* chore: fix OAS for product search endpoint

* added build files
This commit is contained in:
Shahed Nasser authored and GitHub committed 2023-07-12 09:52:33 +02:00
1 parent 52b39896e2
commit 0b84bd5764
2 files changed
+26 -7

No files matched your search

@@ -10,14 +10,13 @@ import { validator } from "../../../../utils/validator"
* operationId: PostProductsSearch
* summary: Search Products
* description: "Run a search query on products using the search engine installed on Medusa"
* parameters:
* - (query) q=* {string} The query to run the search with.
* - (query) offset {integer} How many products to skip in the result.
* - (query) limit {integer} Limit the number of products returned.
* - (query) filter {} Filter based on the search engine.
* requestBody:
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/StorePostSearchReq"
* x-codegen:
* method: search
* queryParams: StorePostSearchReq
* x-codeSamples:
* - lang: JavaScript
* label: JS Client
@@ -76,6 +75,22 @@ export default async (req, res) => {
res.status(200).send(results)
}
/**
* @schema StorePostSearchReq
* type: object
* properties:
* q:
* type: string
* description: The query to run the search with.
* offset:
* type: number
* description: How many products to skip in the result.
* limit:
* type: number
* description: Limit the number of products returned.
* filter:
* description: Filter based on the search engine.
*/
export class StorePostSearchReq {
@IsOptional()
@IsString()