mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-18 11:22:21 -06:00
Refactor DecryptPollVoteDto and schema structure
Updated DecryptPollVoteDto to use a nested message.key structure and moved remoteJid to the top level. Adjusted the controller and validation schema to match the new structure for consistency and clarity.
This commit is contained in:
@@ -116,6 +116,10 @@ export class ChatController {
|
||||
}
|
||||
|
||||
public async decryptPollVote({ instanceName }: InstanceDto, data: DecryptPollVoteDto) {
|
||||
return await this.waMonitor.waInstances[instanceName].baileysDecryptPollVote(data.pollCreationMessageKey);
|
||||
const pollCreationMessageKey = {
|
||||
id: data.message.key.id,
|
||||
remoteJid: data.remoteJid,
|
||||
};
|
||||
return await this.waMonitor.waInstances[instanceName].baileysDecryptPollVote(pollCreationMessageKey);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,10 +129,10 @@ export class BlockUserDto {
|
||||
}
|
||||
|
||||
export class DecryptPollVoteDto {
|
||||
pollCreationMessageKey: {
|
||||
id: string;
|
||||
remoteJid: string;
|
||||
participant?: string;
|
||||
fromMe?: boolean;
|
||||
message: {
|
||||
key: {
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
remoteJid: string;
|
||||
}
|
||||
@@ -452,16 +452,20 @@ export const decryptPollVoteSchema: JSONSchema7 = {
|
||||
$id: v4(),
|
||||
type: 'object',
|
||||
properties: {
|
||||
pollCreationMessageKey: {
|
||||
message: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'string' },
|
||||
remoteJid: { type: 'string' },
|
||||
participant: { type: 'string' },
|
||||
fromMe: { type: 'boolean' },
|
||||
key: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'string' },
|
||||
},
|
||||
required: ['id'],
|
||||
},
|
||||
},
|
||||
required: ['id', 'remoteJid'],
|
||||
required: ['key'],
|
||||
},
|
||||
remoteJid: { type: 'string' },
|
||||
},
|
||||
required: ['pollCreationMessageKey'],
|
||||
required: ['message', 'remoteJid'],
|
||||
};
|
||||
Reference in New Issue
Block a user