Ghost/core/server/services/webhooks/payload.js
kirrg001 b83232bf0c Added more webhooks & changed payload
refs #10461

- do not break the existing webhooks by keeping both payload formats for subscribers events
- refactored webhooks service to run models through target API version
- added new events described in the target issue reference
- this refactoring & enhancement is undocumented, further breaking changes will happen because we are actively working on: https://github.com/TryGhost/Ghost/issues/10438
2019-02-07 23:14:27 +01:00

12 lines
209 B
JavaScript

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