feat: send ptv message

This commit is contained in:
Davidson Gomes
2024-10-28 18:02:17 -03:00
parent 0fdc47e8f0
commit a4e7baa41c
6 changed files with 106 additions and 14 deletions

View File

@@ -7,6 +7,7 @@ import {
SendLocationDto,
SendMediaDto,
SendPollDto,
SendPtvDto,
SendReactionDto,
SendStatusDto,
SendStickerDto,
@@ -22,6 +23,7 @@ import {
locationMessageSchema,
mediaMessageSchema,
pollMessageSchema,
ptvMessageSchema,
reactionMessageSchema,
statusMessageSchema,
stickerMessageSchema,
@@ -71,6 +73,18 @@ export class MessageRouter extends RouterBroker {
return res.status(HttpStatus.CREATED).json(response);
})
.post(this.routerPath('sendPtv'), ...guards, upload.single('file'), async (req, res) => {
const bodyData = req.body;
const response = await this.dataValidate<SendPtvDto>({
request: req,
schema: ptvMessageSchema,
ClassRef: SendPtvDto,
execute: (instance) => sendMessageController.sendPtv(instance, bodyData, req.file as any),
});
return res.status(HttpStatus.CREATED).json(response);
})
.post(this.routerPath('sendWhatsAppAudio'), ...guards, upload.single('file'), async (req, res) => {
const bodyData = req.body;