mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-13 15:14:49 -06:00
feat: Route to fetch all privacy settings
This commit is contained in:
parent
ea8d6bf6c8
commit
55e36f24a5
@ -5,6 +5,7 @@
|
||||
* Improved fetch instances endpoint, now it also fetch other instances even if they are not connected
|
||||
* Added conversion of audios for sending recorded audio, now it is possible to send mp3 audios and not just ogg
|
||||
* Route to fetch all groups that the connection is part of
|
||||
* Route to fetch all privacy settings
|
||||
|
||||
### Fixed
|
||||
|
||||
|
@ -63,6 +63,10 @@ export class ChatController {
|
||||
return await this.waMonitor.waInstances[instanceName].fetchChats();
|
||||
}
|
||||
|
||||
public async fetchPrivacySettings({ instanceName }: InstanceDto) {
|
||||
return await this.waMonitor.waInstances[instanceName].fetchPrivacySettings();
|
||||
}
|
||||
|
||||
public async getBusinessProfile(
|
||||
{ instanceName }: InstanceDto,
|
||||
data: ProfilePictureDto,
|
||||
|
@ -140,6 +140,16 @@ export class ChatRouter extends RouterBroker {
|
||||
return res.status(HttpStatus.OK).json(response);
|
||||
})
|
||||
// Profile routes
|
||||
.get(this.routerPath('fetchPrivacySettings'), ...guards, async (req, res) => {
|
||||
const response = await this.dataValidate<InstanceDto>({
|
||||
request: req,
|
||||
schema: null,
|
||||
ClassRef: InstanceDto,
|
||||
execute: (instance) => chatController.fetchPrivacySettings(instance),
|
||||
});
|
||||
|
||||
return res.status(HttpStatus.OK).json(response);
|
||||
})
|
||||
.post(this.routerPath('getBusinessProfile'), ...guards, async (req, res) => {
|
||||
const response = await this.dataValidate<ProfilePictureDto>({
|
||||
request: req,
|
||||
|
@ -1475,6 +1475,10 @@ export class WAStartupService {
|
||||
return await this.repository.chat.find({ where: { owner: this.instance.wuid } });
|
||||
}
|
||||
|
||||
public async fetchPrivacySettings() {
|
||||
return await this.client.fetchPrivacySettings();
|
||||
}
|
||||
|
||||
public async getBusinessProfile(number: string) {
|
||||
try {
|
||||
let jid;
|
||||
|
Loading…
Reference in New Issue
Block a user