Skip to content

Commit

Permalink
fix: Receive files on set group profile pic
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jul 21, 2022
1 parent 82c568f commit 6f02e09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/controller/groupController.js
Expand Up @@ -364,9 +364,16 @@ export async function changePrivacyGroup(req, res) {
export async function setGroupProfilePic(req, res) {
const { phone, path } = req.body;

if (!path && !req.file)
return res.status(401).send({
message: 'Sending the image is mandatory',
});

const pathFile = path || req.file.path;

try {
for (const contato of contactToArray(phone, true)) {
await req.client.setGroupIcon(contato, path);
await req.client.setGroupIcon(contato, pathFile);
}

return res
Expand Down

0 comments on commit 6f02e09

Please sign in to comment.