update paid account to active if it's in deactivated (#287)

* update paid account to active if it's in deactivated

* fix review comment
This commit is contained in:
Hoan Luu Huu
2024-01-17 21:20:38 +07:00
committed by GitHub
parent 8b2a2e196e
commit 33c3b99e2e

View File

@@ -199,8 +199,9 @@ class Account extends Model {
debug(r3, 'Account.activateSubscription - replaced old subscription');
/* update account.plan to paid, if it isnt already */
/* update account.is_active to 1, if account is deactivated */
await promisePool.execute(
'UPDATE accounts SET plan_type = \'paid\' WHERE account_sid = ?',
'UPDATE accounts SET plan_type = \'paid\', is_active = 1 WHERE account_sid = ?',
[account_sid]);
return true;
}