mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Limited legacy subscriber webhook payload to v2 only (#11139)
no issue - In v3 we don't need to support any legacy webhook formats - Added a comment about the removal of the format when v2 is dropped
This commit is contained in:
parent
3b65081b5e
commit
6f9026af6b
1 changed files with 10 additions and 7 deletions
|
@ -70,14 +70,17 @@ module.exports = (event, model) => {
|
|||
}
|
||||
};
|
||||
|
||||
// @TODO: remove in v3
|
||||
// @NOTE: Our webhook format has changed, we still have to support the old format for subscribers events
|
||||
if ('subscriber.added' === event) {
|
||||
payload[docName] = [current];
|
||||
}
|
||||
// @NOTE: Our webhook format has changed, we still have to support the old format
|
||||
// for subscribers events. No need to support it passed v2 version
|
||||
// @TODO: Remove whole if block when dropping Ghost v2
|
||||
if (apiVersion === 'v2') {
|
||||
if ('subscriber.added' === event) {
|
||||
payload[docName] = [current];
|
||||
}
|
||||
|
||||
if ('subscriber.deleted' === event) {
|
||||
payload[docName] = [previous];
|
||||
if ('subscriber.deleted' === event) {
|
||||
payload[docName] = [previous];
|
||||
}
|
||||
}
|
||||
|
||||
return payload;
|
||||
|
|
Loading…
Add table
Reference in a new issue