Hello, I am using the code below to post content to a collection using Zapier.
How can I publish content in several differents collections, using the same code please?
Where to insert the code for the other collections without breaking the JS?
Thanks for your help.
'use strict';
import {ok, response, serverError, badRequest} from 'wix-http-functions';
import wixData from 'wix-data';
export function post_addthings(request) { // POST = Method
return request.body.json()
.then(body => {
let recordInsert = {
"title": body.title,
"description": body.description,
"source": body.source,
"image": body.image,
};
return wixData.insert('Database', recordInsert)
.then(result => ok({body: JSON.stringify(result)}))
.catch(err => response({status: 500, body: err}));
}
);
}