@xuda.io/account_module 1.2.423 → 1.2.425
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 +8 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -69,8 +69,14 @@ export const update_account_info = async function (req, job_id, headers) {
|
|
|
69
69
|
if (account_obj.account_info['profile_picture'].includes('googleusercontent')) {
|
|
70
70
|
account_obj.account_info['profile_picture_google'] = val;
|
|
71
71
|
} else {
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
//delete old profile picture
|
|
73
|
+
const profile_picture = path.basename(account_obj.account_info['profile_picture']);
|
|
74
|
+
drive_module.delete_drive_files({ uid, drive_type: 'user', files_arr: [profile_picture] });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const profile_avatar = path.basename(account_obj.account_info['profile_avatar']);
|
|
78
|
+
if (profile_avatar) {
|
|
79
|
+
drive_module.delete_drive_files({ uid, drive_type: 'user', files_arr: [profile_avatar] });
|
|
74
80
|
}
|
|
75
81
|
}
|
|
76
82
|
|
|
@@ -225,7 +231,6 @@ export const increment_account_usage = async function (req) {
|
|
|
225
231
|
opt.key = uid;
|
|
226
232
|
}
|
|
227
233
|
const accounts_ret = await db_module.get_couch_view_raw('xuda_accounts', 'all_accounts', opt);
|
|
228
|
-
|
|
229
234
|
const drive_module = await import(`${module_path}/drive_module/index.mjs`);
|
|
230
235
|
|
|
231
236
|
function bytesToGB(bytes) {
|