Skip to content

Commit

Permalink
fix: send file name on send-file-base64 and docs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jul 12, 2022
1 parent 8c7d6fa commit 3016f2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/controller/messageController.js
Expand Up @@ -92,7 +92,7 @@ export async function sendFile(req, res) {
}

export async function sendFile64(req, res) {
const { base64, phone } = req.body;
const { base64, phone, filename } = req.body;

if (!base64) return res.status(401).send({ message: 'The base64 of the file was not informed' });

Expand All @@ -101,7 +101,7 @@ export async function sendFile64(req, res) {
try {
let results = [];
for (const contato of phone) {
results.push(await req.client.sendFile(contato, base64, options));
results.push(await req.client.sendFile(contato, base64, options.length > 0 ? options : filename));
}

if (results.length === 0) return res.status(400).json('Error sending message');
Expand Down

0 comments on commit 3016f2f

Please sign in to comment.