Ghost/core/server/services/webhooks/payload.js
kirrg001 3459f38c09 Fixed webhook payload
no issue

- async code was not handled
2019-02-25 09:38:08 +01:00

18 lines
374 B
JavaScript

const serialize = require('./serialize');
const Promise = require('bluebird');
module.exports = (event, model) => {
const payload = {};
if (model) {
return serialize(event, model)
.then((result) => {
Object.assign(payload, result);
return payload;
});
}
return Promise.resolve(payload);
};