mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-01-12 14:52:24 -06:00
feature: add endpoint to retrieve chat data by phone number
This commit is contained in:
@@ -191,6 +191,16 @@ export class ChatRouter extends RouterBroker {
|
||||
|
||||
return res.status(HttpStatus.OK).json(response);
|
||||
})
|
||||
.get(this.routerPath('findChatByRemoteJid'), ...guards, async (req, res) => {
|
||||
const instance = req.params as unknown as InstanceDto;
|
||||
const { remoteJid } = req.query as unknown as { remoteJid: string };
|
||||
if (!remoteJid) {
|
||||
return res.status(HttpStatus.BAD_REQUEST).json({ error: "remoteJid is a required query parameter" });
|
||||
}
|
||||
const response = await chatController.findChatByRemoteJid(instance, remoteJid);
|
||||
|
||||
return res.status(HttpStatus.OK).json(response);
|
||||
})
|
||||
// Profile routes
|
||||
.post(this.routerPath('fetchBusinessProfile'), ...guards, async (req, res) => {
|
||||
const response = await this.dataValidate<ProfilePictureDto>({
|
||||
|
||||
Reference in New Issue
Block a user