From 33c3b99e2e2abd7efdf97db5a575b9da5df83677 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Wed, 17 Jan 2024 21:20:38 +0700 Subject: [PATCH] update paid account to active if it's in deactivated (#287) * update paid account to active if it's in deactivated * fix review comment --- lib/models/account.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/models/account.js b/lib/models/account.js index beb3834..ea9026c 100644 --- a/lib/models/account.js +++ b/lib/models/account.js @@ -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; }