@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.
Files changed (2) hide show
  1. package/index.mjs +8 -3
  2. 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
- const image_name = path.basename(account_obj.account_info['profile_picture']);
73
- drive_module.delete_drive_files({ uid, drive_type: 'user', files_arr: [image_name] });
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.423",
3
+ "version": "1.2.425",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {