Patch subscription plan frontend validation

This commit is contained in:
Tuan Dang
2023-06-12 17:47:32 +01:00
parent 342ee50063
commit 98efffafaa
6 changed files with 44 additions and 33 deletions
+17 -15
View File
@@ -153,22 +153,24 @@ export const updateSubscriptionOrgQuantity = async ({
EELicenseService.localFeatureSet.del(organizationId);
}
if (EELicenseService.instanceType === 'enterprise-self-hosted') {
// instance of Infisical is an enterprise self-hosted instance
const usedSeats = await MembershipOrg.countDocuments({
status: ACCEPTED
});
await licenseKeyRequest.patch(
`${await getLicenseServerUrl()}/api/license/v1/license`,
{
usedSeats
}
);
}
}
if (EELicenseService.instanceType === 'enterprise-self-hosted') {
// instance of Infisical is an enterprise self-hosted instance
const usedSeats = await MembershipOrg.countDocuments({
status: ACCEPTED
});
await licenseKeyRequest.patch(
`${await getLicenseServerUrl()}/api/license/v1/license`,
{
usedSeats
}
);
}
await EELicenseService.refreshOrganizationPlan(organizationId);
return stripeSubscription;
};