Skip to content

Commit

Permalink
feat: Added route take-screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed May 31, 2023
1 parent 9d9bcc7 commit 1cab9aa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/controller/miscController.ts
Expand Up @@ -109,3 +109,27 @@ export async function restoreAllSessions(req: Request, res: Response) {
});
}
}

export async function takeScreenshot(req: Request, res: Response) {
/**
#swagger.tags = ["Misc"]
#swagger.autoBody=false
#swagger.security = [{
"bearerAuth": []
}]
#swagger.parameters["session"] = {
schema: 'NERDWHATS_AMERICA'
}
*/

try {
const result = await (req.client as any)?.takeScreenshot();
return res.status(200).json(result);
} catch (error: any) {
return res.status(500).json({
status: false,
message: 'Error on take screenshot or not implemented yet',
error: error,
});
}
}
1 change: 1 addition & 0 deletions src/routes/index.ts
Expand Up @@ -809,6 +809,7 @@ routes.post(
upload.single('file'),
MiscController.restoreAllSessions
);
routes.get('/api/:session/take-screenshot', MiscController.takeScreenshot);

routes.post('/api/:session/chatwoot', DeviceController.chatWoot);

Expand Down

0 comments on commit 1cab9aa

Please sign in to comment.