Hello team, airtable api are failing & throwing random errors, works on local but fails on production…
API Code -
const Airtable = require('airtable');
const base = new Airtable({
apiKey: 'API_KEY',
requestTimeout: 1000
}).base('BASE_ID');
function updateAirtableSheetValues(data){
base('Table 1').create([
{
"fields": {
"Name": data
}
}
], function(err, records) {
if (err) {
console.error(err);
return;
}
records.forEach(function (record) {
console.log(record.getId());
});
});
}
export default async (req, res) => {
if (req.method === "POST") {
const { body } = req;
updateAirtableSheetValues(body.data);
res.statusCode = 200;
}
res.json({ msg: "Thank you" });
};
Error -