Hey @binyaminm thanks for your answer,
I need data from the frontend but if I insert data to the collection before the succeed message the insert action to the collection starts a webhook trigger.
In the events.js onPaymentUpdate() I can’t get the form field data that the user input.
import wixCrm from 'wix-crm-backend';
import { fetch } from 'wix-fetch';
function sendDataEvent (item, webhook) {
fetch(webhook, {
"method": "post",
"headers": {
"Content-Type": "application/json"
},
"body": JSON.stringify(item)
})
.then((httpResponse) => {
if (httpResponse.ok) {
return httpResponse.json();
} else {
return Promise.reject("Fetch did not succeed");
}
})
.then((json) => console.log(json))
.catch(err => console.log(err));
}
export function EventLead_afterInsert(item, context) {
webhook = "https://hook.integromat.com/................/"
sendDataEvent(item, webhook);
return item
}
export function Payments_afterInsert(item, context) {
webhook = "https://hook.integromat.com/................/",
sendDataEvent(item, webhook);
return item
}