@xuda.io/account_module 1.2.2194 → 1.2.2196
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +4 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -274,6 +274,7 @@ export const increment_account_usage = async function (req) {
|
|
|
274
274
|
|
|
275
275
|
if (Date.now() - doc.ts >= interval) {
|
|
276
276
|
const plan = _conf.PLAN_OBJ[account_data.membership_plan];
|
|
277
|
+
if (!plan) throw new Error(`${account_data.account_info.first_name + ' ' + account_data.account_info.last_name} has no plan`);
|
|
277
278
|
const drive_size_total = account_data.user_drive_size + account_data.studio_drive_size + account_data.workspace_drive_size + account_data.builds_drive_size + account_data.plugins_drive_size;
|
|
278
279
|
if (bytesToGB(drive_size_total) > plan.features.drive) {
|
|
279
280
|
var price_per_hour = (bytesToGB(drive_size_total) * _conf.PRICE_OBJ.price_per_gb_drive) / _conf.PRICE_OBJ.avg_hours_in_month;
|
|
@@ -574,9 +575,9 @@ export const get_active_account_profile_info = async function (uid, profile_id)
|
|
|
574
575
|
|
|
575
576
|
return { uid: account_profile_obj.shared_from_uid || uid, account_profile_id: active_account_profile_id, app_id, is_main: active_account_profile_id === acc_obj.account_profile_id, account_profile_obj };
|
|
576
577
|
} catch (err) {
|
|
577
|
-
console.
|
|
578
|
-
console.error(err.message);
|
|
579
|
-
debugger;
|
|
578
|
+
console.warn('**** get_active_account_profile_info', err);
|
|
579
|
+
// console.error(err.message);
|
|
580
|
+
// debugger;
|
|
580
581
|
throw err;
|
|
581
582
|
}
|
|
582
583
|
};
|