mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #10005 from overleaf/em-revert-get-best-subscription
Revert "pass requester data when fetching best subscription" GitOrigin-RevId: 7d66ef9d1c136cd729b648266117f42dd38e06b6
This commit is contained in:
parent
2aaeea68a9
commit
8f63e21026
3 changed files with 4 additions and 9 deletions
|
@ -478,7 +478,6 @@ const ProjectController = {
|
|||
}
|
||||
SubscriptionViewModelBuilder.getBestSubscription(
|
||||
{ _id: userId },
|
||||
{ id: userId, ip: req.ip },
|
||||
(err, subscription) => {
|
||||
if (err) {
|
||||
// do not fail loading the project list when fetching the best subscription fails
|
||||
|
|
|
@ -340,7 +340,7 @@ function buildUsersSubscriptionViewModel(user, callback) {
|
|||
* @param {{_id: string}} user
|
||||
* @returns {Promise<Subscription>}
|
||||
*/
|
||||
async function getBestSubscription(user, requesterData = {}) {
|
||||
async function getBestSubscription(user) {
|
||||
let [
|
||||
individualSubscription,
|
||||
memberGroupSubscriptions,
|
||||
|
@ -361,8 +361,7 @@ async function getBestSubscription(user, requesterData = {}) {
|
|||
)
|
||||
await SubscriptionUpdater.promises.updateSubscriptionFromRecurly(
|
||||
recurlySubscription,
|
||||
individualSubscription,
|
||||
requesterData
|
||||
individualSubscription
|
||||
)
|
||||
individualSubscription =
|
||||
await SubscriptionLocator.promises.getUsersSubscription(user)
|
||||
|
|
|
@ -229,11 +229,9 @@ describe('SubscriptionViewModelBuilder', function () {
|
|||
})
|
||||
.resolves(this.recurlySubscription)
|
||||
|
||||
const requesterData = { id: this.user._id, ip: '1.2.3.4' }
|
||||
const usersBestSubscription =
|
||||
await this.SubscriptionViewModelBuilder.promises.getBestSubscription(
|
||||
this.user,
|
||||
requesterData
|
||||
this.user
|
||||
)
|
||||
|
||||
sinon.assert.calledWith(
|
||||
|
@ -244,8 +242,7 @@ describe('SubscriptionViewModelBuilder', function () {
|
|||
sinon.assert.calledWith(
|
||||
this.SubscriptionUpdater.promises.updateSubscriptionFromRecurly,
|
||||
this.recurlySubscription,
|
||||
this.individualSubscriptionWithoutRecurly,
|
||||
requesterData
|
||||
this.individualSubscriptionWithoutRecurly
|
||||
)
|
||||
assert.deepEqual(usersBestSubscription, {
|
||||
type: 'individual',
|
||||
|
|
Loading…
Reference in a new issue