mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
b83232bf0c
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
12 lines
209 B
JavaScript
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;
|
|
};
|