mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-19 09:53:36 -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
|
* 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
|
* 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 groups that the connection is part of
|
||||||
|
* Route to fetch all privacy settings
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -63,6 +63,10 @@ export class ChatController {
|
|||||||
return await this.waMonitor.waInstances[instanceName].fetchChats();
|
return await this.waMonitor.waInstances[instanceName].fetchChats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async fetchPrivacySettings({ instanceName }: InstanceDto) {
|
||||||
|
return await this.waMonitor.waInstances[instanceName].fetchPrivacySettings();
|
||||||
|
}
|
||||||
|
|
||||||
public async getBusinessProfile(
|
public async getBusinessProfile(
|
||||||
{ instanceName }: InstanceDto,
|
{ instanceName }: InstanceDto,
|
||||||
data: ProfilePictureDto,
|
data: ProfilePictureDto,
|
||||||
|
@ -140,6 +140,16 @@ export class ChatRouter extends RouterBroker {
|
|||||||
return res.status(HttpStatus.OK).json(response);
|
return res.status(HttpStatus.OK).json(response);
|
||||||
})
|
})
|
||||||
// Profile routes
|
// 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) => {
|
.post(this.routerPath('getBusinessProfile'), ...guards, async (req, res) => {
|
||||||
const response = await this.dataValidate<ProfilePictureDto>({
|
const response = await this.dataValidate<ProfilePictureDto>({
|
||||||
request: req,
|
request: req,
|
||||||
|
@ -1475,6 +1475,10 @@ export class WAStartupService {
|
|||||||
return await this.repository.chat.find({ where: { owner: this.instance.wuid } });
|
return await this.repository.chat.find({ where: { owner: this.instance.wuid } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async fetchPrivacySettings() {
|
||||||
|
return await this.client.fetchPrivacySettings();
|
||||||
|
}
|
||||||
|
|
||||||
public async getBusinessProfile(number: string) {
|
public async getBusinessProfile(number: string) {
|
||||||
try {
|
try {
|
||||||
let jid;
|
let jid;
|
||||||
|
Loading…
Reference in New Issue
Block a user