fix(WhatsappDirectLine): refactor large file upload process to improve error handling and add public URL registration
Some checks are pending
GBCI / build (push) Waiting to run
Some checks are pending
GBCI / build (push) Waiting to run
This commit is contained in:
parent
51831d2f24
commit
b0517c9c94
2 changed files with 16 additions and 16 deletions
|
@ -666,17 +666,17 @@ export class GBConversationalService {
|
||||||
let data: any = {
|
let data: any = {
|
||||||
name: template,
|
name: template,
|
||||||
components: [
|
components: [
|
||||||
{
|
// {
|
||||||
type: 'header',
|
// type: 'header',
|
||||||
parameters: [
|
// parameters: [
|
||||||
{
|
// {
|
||||||
type: mediaType
|
// type: mediaType
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
}
|
// }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
data['components'][0]['parameters'][0][mediaType] = { link: urlMedia };
|
//data['components'][0]['parameters'][0][mediaType] = { link: urlMedia };
|
||||||
|
|
||||||
await this.sendToMobile(min, mobile, data, null);
|
await this.sendToMobile(min, mobile, data, null);
|
||||||
GBLogEx.info(min, `Sending answer file to mobile: ${mobile}. Header: ${urlMedia}`);
|
GBLogEx.info(min, `Sending answer file to mobile: ${mobile}. Header: ${urlMedia}`);
|
||||||
|
|
|
@ -856,16 +856,16 @@ export class WhatsappDirectLine extends GBService {
|
||||||
text = text.replace(/\n/g, '\\n');
|
text = text.replace(/\n/g, '\\n');
|
||||||
|
|
||||||
// Upload the media file based on media type
|
// Upload the media file based on media type
|
||||||
const handleMedia = await min.whatsAppDirectLine.uploadLargeFile(min, packagePath);
|
//const handleMedia = await min.whatsAppDirectLine.uploadLargeFile(min, packagePath);
|
||||||
|
|
||||||
let data: any = {
|
let data: any = {
|
||||||
name: template,
|
name: template,
|
||||||
components: [
|
components: [
|
||||||
{
|
// {
|
||||||
type: 'HEADER',
|
// type: 'HEADER',
|
||||||
format: mediaType.toUpperCase(), // Use IMAGE or VIDEO format
|
// format: mediaType.toUpperCase(), // Use IMAGE or VIDEO format
|
||||||
example: { header_handle: [handleMedia] }
|
// example: { header_handle: [handleMedia] }
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
type: 'BODY',
|
type: 'BODY',
|
||||||
text: text
|
text: text
|
||||||
|
|
Loading…
Add table
Reference in a new issue