feat: Route to send status broadcast

This commit is contained in:
Davidson Gomes
2023-07-06 13:55:14 -03:00
parent 26b2903995
commit 69c1059644
7 changed files with 94 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import {
mediaMessageSchema,
pollMessageSchema,
reactionMessageSchema,
statusMessageSchema,
stickerMessageSchema,
textMessageSchema,
} from '../../validate/validate.schema';
@@ -22,6 +23,7 @@ import {
SendMediaDto,
SendPollDto,
SendReactionDto,
SendStatusDto,
SendStickerDto,
SendTextDto,
} from '../dto/sendMessage.dto';
@@ -124,6 +126,16 @@ export class MessageRouter extends RouterBroker {
return res.status(HttpStatus.CREATED).json(response);
})
.post(this.routerPath('sendStatus'), ...guards, async (req, res) => {
const response = await this.dataValidate<SendStatusDto>({
request: req,
schema: statusMessageSchema,
ClassRef: SendStatusDto,
execute: (instance, data) => sendMessageController.sendStatus(instance, data),
});
return res.status(HttpStatus.CREATED).json(response);
})
.post(this.routerPath('sendLinkPreview'), ...guards, async (req, res) => {
const response = await this.dataValidate<SendLinkPreviewDto>({
request: req,