Add forwarding usedSeats and subscription quantity to license server on org member add/delete

This commit is contained in:
Tuan Dang
2023-05-23 16:59:13 +03:00
parent 8341faddc5
commit 899d46514c
4 changed files with 69 additions and 26 deletions
@@ -135,6 +135,7 @@ export const inviteUserToOrganization = async (req: Request, res: Response) => {
}
if (!inviteeMembershipOrg) {
await new MembershipOrg({
user: invitee,
inviteEmail: inviteeEmail,
@@ -246,6 +247,10 @@ export const verifyUserToOrganization = async (req: Request, res: Response) => {
// membership can be approved and redirected to login/dashboard
membershipOrg.status = ACCEPTED;
await membershipOrg.save();
await updateSubscriptionOrgQuantity({
organizationId
});
return res.status(200).send({
message: 'Successfully verified email',