Hello,
I set up various http requests to pull data into my wix database - POSTS and PUTS. They were all working fine last week and now none of them work. I am connecting to a 3rd party app via Zapier and webhooks to Wix Code. I am getting this error in Zapier:
(‘Connection aborted.’, error(“(104, ‘ECONNRESET’)”,))
Other zaps with the same 3rd party app are working fine. I haven’t made any changes to the code. I may be missing something silly, but I have literally changed nothing from when they were working perfectly. Here is the code for one of them. Any help is greatly appreciated. Thanks.
‘use strict’;
import wixData from ‘wix-data’;
import {ok, response} from ‘wix-http-functions’;
export function post_storerecords (request) {
return request.body.json()
.then(body => {
if (body.secretKey === “”){
let dateTime = new Date(body.date_time);
let recordInsert = {
“title”: body.title,
“pro”: body.pro,
“clientFirstName”: body.clientFirstName,
“clientLastName”: body.clientLastName,
“clientEmail”: body.clientEmail,
“apptDate”: body.apptDate,
“apptTime”: body.apptTime,
“date_time”: dateTime,
“apptPrice”: body.apptPrice,
“amtPaid”: body.amtPaid,
“apptLocation”: body.apptLocation,
“apptType”: body.apptType,
“category”: body.category,
“duration”: body.duration,
“clientPhone”: body.clientPhone,
“calendarId”: body.calendarId,
“apptTypeId”: body.apptTypeId,
“formQuestion”: body.formQuestion,
“formClubs”: body.formClubs,
“formTopic”: body.formTopic,
“canceled”: body.canceled,
“classId”: body.classId
};
return wixData.insert(‘Bookings’, recordInsert)
.then(result => ok({body: JSON.stringify(result)}))
. catch (err => response({status: 500, body: err}));
}
});
}