mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-24 22:27:46 -06:00
feat(IsOnWhatsapp): add optional lid field and update related logic
- Introduced a new optional `lid` field in the IsOnWhatsapp model to enhance data tracking. - Updated migration script to add the `lid` column to the database. - Modified OnWhatsAppDto to include the `lid` property for better integration with WhatsApp user data. - Enhanced the WhatsApp Baileys service to handle `lid` numbers separately and improve user verification logic. - Updated cache handling functions to support the new `lid` field for consistent data management.
This commit is contained in:
@@ -46,14 +46,19 @@ export class ChatRouter extends RouterBroker {
|
||||
super();
|
||||
this.router
|
||||
.post(this.routerPath('whatsappNumbers'), ...guards, async (req, res) => {
|
||||
const response = await this.dataValidate<WhatsAppNumberDto>({
|
||||
request: req,
|
||||
schema: whatsappNumberSchema,
|
||||
ClassRef: WhatsAppNumberDto,
|
||||
execute: (instance, data) => chatController.whatsappNumber(instance, data),
|
||||
});
|
||||
try {
|
||||
const response = await this.dataValidate<WhatsAppNumberDto>({
|
||||
request: req,
|
||||
schema: whatsappNumberSchema,
|
||||
ClassRef: WhatsAppNumberDto,
|
||||
execute: (instance, data) => chatController.whatsappNumber(instance, data),
|
||||
});
|
||||
|
||||
return res.status(HttpStatus.OK).json(response);
|
||||
return res.status(HttpStatus.OK).json(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return res.status(HttpStatus.BAD_REQUEST).json(error);
|
||||
}
|
||||
})
|
||||
.post(this.routerPath('markMessageAsRead'), ...guards, async (req, res) => {
|
||||
const response = await this.dataValidate<ReadMessageDto>({
|
||||
|
||||
Reference in New Issue
Block a user