Merge pull request #2919 from overleaf/ta-admin-update-empty

Allow  Empty Strings in Admin Form Updates

GitOrigin-RevId: 79c1315dcb56ebdd82094653c67dcd83b1b53b87
This commit is contained in:
Jessica Lawshe 2020-06-18 09:05:41 -05:00 committed by Copybot
parent cc46e33681
commit 366a925903

View file

@ -1,4 +1,4 @@
const { ObjectId } = require('../../../../app/src/infrastructure/mongojs')
const { db, ObjectId } = require('../../../../app/src/infrastructure/mongojs')
const { expect } = require('chai')
const SubscriptionUpdater = require('../../../../app/src/Features/Subscription/SubscriptionUpdater')
const SubscriptionModel = require('../../../../app/src/models/Subscription')
@ -14,6 +14,7 @@ class Subscription {
this.manager_ids = options.managerIds || [this.admin_id]
this.member_ids = options.memberIds || []
this.invited_emails = options.invitedEmails || []
this.teamName = options.teamName
this.teamInvites = options.teamInvites || []
this.planCode = options.planCode
this.recurlySubscription_id = options.recurlySubscription_id
@ -38,6 +39,10 @@ class Subscription {
)
}
get(callback) {
db.subscriptions.findOne({ _id: ObjectId(this._id) }, callback)
}
setManagerIds(managerIds, callback) {
return SubscriptionModel.findOneAndUpdate(
{ _id: ObjectId(this._id) },