@xuda.io/account_module 1.2.414 → 1.2.415

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 +10 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -30,6 +30,12 @@ export const update_account_info = async function (req, job_id, headers) {
30
30
  const { uid } = req;
31
31
  const data = req;
32
32
 
33
+ delete data.gtp_token;
34
+ delete data.uid;
35
+ delete data.token_ret;
36
+ delete data.job_id;
37
+ delete data.profile_avatar;
38
+
33
39
  function validate_input(string, max_length, is_mandatory, is_pass) {
34
40
  if (!/^[a-zA-Z0-9,.@ ]*$/.test(string) && !is_pass) {
35
41
  // if (!preg_match('^[a-zA-Z0-9,.@ ]*$', string) && !is_pass) {
@@ -59,10 +65,6 @@ export const update_account_info = async function (req, job_id, headers) {
59
65
  account_info_changes_arr.push(key);
60
66
  account_obj.account_info[key] = val;
61
67
 
62
- if (key === 'profile_picture') {
63
- account_obj.account_info['profile_avatar'] = '';
64
- }
65
-
66
68
  if (account_obj.account_info.account_type === 'business') {
67
69
  if (key === 'company_name' && validate_input(val, 150, true, false) < 0) {
68
70
  error[key] = 'Invalid company';
@@ -109,6 +111,10 @@ export const update_account_info = async function (req, job_id, headers) {
109
111
  return { code: 1300, data: 'no change' };
110
112
  }
111
113
 
114
+ if (account_info_changes_arr.includes('profile_picture')) {
115
+ account_obj.account_info['profile_avatar'] = '';
116
+ }
117
+
112
118
  //clean up received from req
113
119
  delete account_obj.account_info.gtp_token;
114
120
  delete account_obj.account_info.client_id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.414",
3
+ "version": "1.2.415",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {