mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-19 03:42:23 -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) {
|
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 {
|
export class DecryptPollVoteDto {
|
||||||
pollCreationMessageKey: {
|
message: {
|
||||||
id: string;
|
key: {
|
||||||
remoteJid: string;
|
id: string;
|
||||||
participant?: string;
|
};
|
||||||
fromMe?: boolean;
|
|
||||||
};
|
};
|
||||||
|
remoteJid: string;
|
||||||
}
|
}
|
||||||
@@ -452,16 +452,20 @@ export const decryptPollVoteSchema: JSONSchema7 = {
|
|||||||
$id: v4(),
|
$id: v4(),
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
pollCreationMessageKey: {
|
message: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
id: { type: 'string' },
|
key: {
|
||||||
remoteJid: { type: 'string' },
|
type: 'object',
|
||||||
participant: { type: 'string' },
|
properties: {
|
||||||
fromMe: { type: 'boolean' },
|
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