Skip to content

Commit

Permalink
fix: Archive chat malforming and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jun 23, 2022
1 parent f163cd0 commit 1f6515b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/controller/deviceController.js
Expand Up @@ -254,11 +254,7 @@ export async function archiveChat(req, res) {

try {
let response;
if (isGroup) {
response = await req.client.archiveChat(`${phone}@g.us`, value);
} else {
response = await req.client.archiveChat(`${phone}@c.us`, value);
}
response = await req.client.archiveChat(`${phone}`, value);
return res.status(201).json({ status: 'success', response: response });
} catch (e) {
req.logger.error(e);
Expand Down
3 changes: 2 additions & 1 deletion src/swagger.json
Expand Up @@ -3520,7 +3520,8 @@
"$ref": "#/components/schemas/ArchiveChatRequest"
},
"example": {
"phone": "556593077171"
"phone": "556593077171",
"isGroup": false
}
}
},
Expand Down

0 comments on commit 1f6515b

Please sign in to comment.