Skip to content

Commit

Permalink
fix: Fixed docs for get business profile products
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Nov 15, 2023
1 parent 9d42589 commit 004fbbb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/controller/orderController.ts
Expand Up @@ -59,15 +59,20 @@ export async function getBusinessProfilesProducts(req: Request, res: Response) {
#swagger.parameters["session"] = {
schema: 'NERDWHATS_AMERICA'
}
#swagger.parameters["phone"] = {
in: 'query',
schema: '5521999999999@c.us',
}
*/
const session = req.session;
const { phone } = req.body;
const { phone } = req.query as unknown as any;

try {
const results: any = [];

for (const contato of phone) {
results.push(await req.client.getBusinessProfilesProducts(contato));
const result = await req.client.getBusinessProfilesProducts(contato);
results.push(result);
}

returnSucess(res, session, phone, results);
Expand Down
14 changes: 11 additions & 3 deletions src/swagger.json
Expand Up @@ -644,8 +644,8 @@
}
],
"responses": {
"400": {
"description": "Bad Request"
"default": {
"description": ""
}
},
"security": [
Expand Down Expand Up @@ -674,7 +674,7 @@
"examples": {
"Edit a message": {
"value": {
"id": "7787877872655655ad@ads858598.c.us",
"id": "true_5521999999999@c.us_3EB04FCAA1527EB6D9DEC8",
"newText": "New text for message"
}
}
Expand Down Expand Up @@ -6768,6 +6768,14 @@
"type": "string",
"example": "NERDWHATS_AMERICA"
}
},
{
"name": "phone",
"in": "query",
"schema": {
"type": "string",
"example": "5521999999999@c.us"
}
}
],
"responses": {
Expand Down

0 comments on commit 004fbbb

Please sign in to comment.