diff --git a/core/server/api/canary/members.js b/core/server/api/canary/members.js index ff8f8470ca..b1bd51db22 100644 --- a/core/server/api/canary/members.js +++ b/core/server/api/canary/members.js @@ -185,7 +185,7 @@ module.exports = { permissions: true, async query(frame) { try { - frame.options.withRelated = ['stripeSubscriptions']; + frame.options.withRelated = ['stripeSubscriptions', 'labels']; const member = await membersService.api.members.update(frame.data.members[0], frame.options); const hasCompedSubscription = !!member.related('stripeSubscriptions').find(sub => sub.get('plan_nickname') === 'Complimentary' && sub.get('status') === 'active'); diff --git a/core/server/models/member.js b/core/server/models/member.js index 7d1eb1b4d4..e558086514 100644 --- a/core/server/models/member.js +++ b/core/server/models/member.js @@ -109,6 +109,11 @@ const Member = ghostBookshelf.Model.extend({ let labelsToSave = []; let ops = []; + if (_.isUndefined(this.get('labels'))) { + this.unset('labels'); + return; + } + // CASE: detect lowercase/uppercase label slugs if (!_.isUndefined(this.get('labels')) && !_.isNull(this.get('labels'))) { labelsToSave = [];