Skip to content

Commit

Permalink
[supersaas-component] credit-balance-changes: Ignore appointments cre…
Browse files Browse the repository at this point in the history
…ated/deleted by admins.
  • Loading branch information
Gui Prá committed Oct 31, 2020
1 parent a4f9fa1 commit e5784ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/supersaas/sources/credit-balance-changes.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ module.exports = {
},
},
async run(ev) {
// Ignore appointments created/deleted by admins (i.e. when email is null).
if (!ev.body.email) {
console.log('Ignoring:', ev.body.event, '(but !ev.body.email)');
return;
}

if (ev.body.event === 'create' && !ev.body.price) {
console.log('Ignoring:', ev.body.event, '(but !ev.body.price)');
return;
Expand Down

0 comments on commit e5784ff

Please sign in to comment.