mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 16:44:07 -08:00
fix(Facebook Lead Ads Trigger Node): Fix issue with optional fields (#11692)
This commit is contained in:
parent
b22142ddb8
commit
70d315b3d5
|
@ -273,7 +273,10 @@ export class FacebookLeadAdsTrigger implements INodeType {
|
||||||
return {
|
return {
|
||||||
id: lead.id,
|
id: lead.id,
|
||||||
data: lead.field_data.reduce(
|
data: lead.field_data.reduce(
|
||||||
(acc, field) => ({ ...acc, [field.name]: field.values[0] }),
|
(acc, field) => ({
|
||||||
|
...acc,
|
||||||
|
[field.name]: field.values && field.values.length > 0 ? field.values[0] : null,
|
||||||
|
}),
|
||||||
{},
|
{},
|
||||||
),
|
),
|
||||||
form: {
|
form: {
|
||||||
|
|
|
@ -33,7 +33,7 @@ export async function facebookApiRequest(
|
||||||
qs,
|
qs,
|
||||||
body,
|
body,
|
||||||
gzip: true,
|
gzip: true,
|
||||||
uri: `https://graph.facebook.com/v17.0${resource}`,
|
uri: `https://graph.facebook.com/v21.0${resource}`,
|
||||||
json: true,
|
json: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ export async function facebookAppApiRequest(
|
||||||
method,
|
method,
|
||||||
qs,
|
qs,
|
||||||
gzip: true,
|
gzip: true,
|
||||||
uri: `https://graph.facebook.com/v17.0${resource}`,
|
uri: `https://graph.facebook.com/v21.0${resource}`,
|
||||||
json: true,
|
json: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ export async function facebookPageApiRequest(
|
||||||
qs,
|
qs,
|
||||||
body,
|
body,
|
||||||
gzip: true,
|
gzip: true,
|
||||||
uri: `https://graph.facebook.com/v17.0${resource}`,
|
uri: `https://graph.facebook.com/v21.0${resource}`,
|
||||||
json: true,
|
json: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue