Skip to content

Commit 937b306

Browse files
fix: remove unncessary query from buyaddonusers
1 parent bf56348 commit 937b306

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

apps/OpenSignServer/cloud/parsefunction/BuyAddonUsers.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default async function BuyAddonUsers(request) {
7676
},
7777
],
7878
});
79-
await axios.put(
79+
const updatedSubscription = await axios.put(
8080
'https://www.zohoapis.in/billing/v1/subscriptions/' + subscriptionId,
8181
data,
8282
{
@@ -86,20 +86,11 @@ export default async function BuyAddonUsers(request) {
8686
},
8787
}
8888
);
89-
const hostedpage_id = _resSub.SubscriptionDetails.hostedpage_id;
90-
const userData = await axios.get(
91-
'https://www.zohoapis.in/billing/v1/hostedpages/' + hostedpage_id,
92-
{
93-
headers: {
94-
Authorization: 'Zoho-oauthtoken ' + res.data.access_token,
95-
'X-com-zoho-subscriptions-organizationid': process.env.ZOHO_BILLING_ORG_ID,
96-
},
97-
}
98-
);
89+
const subscriptionInfo = { data: updatedSubscription.data };
9990
const allowedUsers = quantity + 1;
10091
const updateSub = new Parse.Object('contracts_Subscriptions');
10192
updateSub.id = resSub.id;
102-
updateSub.set('SubscriptionDetails', userData.data);
93+
updateSub.set('SubscriptionDetails', subscriptionInfo);
10394
updateSub.set('AllowedUsers', allowedUsers);
10495
const resupdateSub = await updateSub.save(null, { useMasterKey: true });
10596
return { status: 'success', addon: allowedUsers };

0 commit comments

Comments
 (0)