rez_core 2.0.58 → 2.0.60

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.0.58",
3
+ "version": "2.0.60",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -67,17 +67,10 @@ export class LoginController {
67
67
  appcode: string;
68
68
  },
69
69
  ): Promise<any> {
70
- const userId = req.user.userData.id;
71
-
72
- const currentUserLevelType = req.user.userData.level_type;
73
- const currentUserLevelId = req.user.userData.level_id;
74
- const currentUserOrganization_id = req.user.userData.organization_id;
70
+ const currentUser = req.user.userData;
75
71
 
76
72
  return await this.userSessionService.switchCurrentLevelService(
77
- userId,
78
- currentUserLevelType,
79
- currentUserLevelId,
80
- currentUserOrganization_id,
73
+ currentUser,
81
74
  data,
82
75
  );
83
76
  }
@@ -65,10 +65,7 @@ export class UserSessionService {
65
65
  }
66
66
 
67
67
  async switchCurrentLevelService(
68
- userId: number,
69
- currentUserLevelType: string,
70
- currentUserLevelId: string,
71
- currentUserOrgId: number,
68
+ currentUser: any,
72
69
  data: any,
73
70
  ): Promise<{ success: boolean; access_token: string; appcode: string }> {
74
71
  let payload;
@@ -89,15 +86,15 @@ export class UserSessionService {
89
86
  // }
90
87
 
91
88
  payload = {
92
- id: userId,
93
- level_id: currentUserLevelId,
94
- level_type: currentUserLevelType,
89
+ ...currentUser,
90
+ level_id: data.level_id,
91
+ level_type: data.level_type,
95
92
  appcode: data.appcode,
96
93
  };
97
94
 
98
95
  await this.dataSource.query(
99
96
  `UPDATE cr_user SET last_app_access = ? WHERE id = ?`,
100
- [data.appcode, userId],
97
+ [data.appcode, currentUser.id],
101
98
  );
102
99
 
103
100
  // }