fix(basic.gblib): SEND FILE fix for sub directories.

This commit is contained in:
Rodrigo Rodriguez 2024-02-24 15:39:16 -03:00
parent df0addc69b
commit e08a02bec0

View file

@ -1340,13 +1340,13 @@ export class DialogKeywords {
const gbaiName = DialogKeywords.getGBAIPath(min.botId); const gbaiName = DialogKeywords.getGBAIPath(min.botId);
let { baseUrl, client } = await GBDeployer.internalGetDriveClient(min); let { baseUrl, client } = await GBDeployer.internalGetDriveClient(min);
let url = urlJoin('/', gbaiName, `${min.botId}.gbdrive`, filename); const fileUrl = urlJoin('/', gbaiName, `${min.botId}.gbdrive`, filename);
GBLog.info(`BASIC: Direct send from .gbdrive: ${url} to ${mobile}.`); GBLog.info(`BASIC: Direct send from .gbdrive: ${fileUrl} to ${mobile}.`);
const sys = new SystemKeywords(); const sys = new SystemKeywords();
const pathOnly = url.substring(0, url.lastIndexOf('/')); const pathOnly = fileUrl.substring(0, fileUrl.lastIndexOf('/'));
const fileOnly = url.substring(url.lastIndexOf('/') + 1); const fileOnly = fileUrl.substring(fileUrl.lastIndexOf('/') + 1);
let template = await sys.internalGetDocument(client, baseUrl, pathOnly, fileOnly); let template = await sys.internalGetDocument(client, baseUrl, pathOnly, fileOnly);