rez_core 1.0.82 → 1.0.83

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": "1.0.82",
3
+ "version": "1.0.83",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -97,7 +97,7 @@ export class EntityListService {
97
97
  entityTab.tab_value = 'ALL';
98
98
  entityTab.tab_value_count = all;
99
99
  tabs.push(entityTab);
100
- return tabs;
100
+ return tabs.reverse();
101
101
  }
102
102
 
103
103
  private getQuery(source: string, groupByColumn: string | null) {
@@ -9,32 +9,24 @@ export class UserRepository {
9
9
  @InjectRepository(UserData) private userRepository: Repository<UserData>,
10
10
  ) {}
11
11
 
12
- async findById(userId: number ): Promise<UserData | null> {
12
+ async findById(userId: number): Promise<UserData | null> {
13
13
  return this.userRepository.findOne({ where: { id: userId } });
14
14
  }
15
- async findByEmailId(email: string, organization_id?: number): Promise<UserData | null> {
15
+ async findByEmailId(email: string): Promise<UserData | null> {
16
16
  if (!email) return null;
17
-
17
+
18
18
  const where: any = { email_id: email };
19
- if (organization_id !== undefined) {
20
- where.organization_id = organization_id;
21
- }
22
-
19
+
23
20
  return this.userRepository.findOne({ where });
24
21
  }
25
-
26
- async findByMobile(mobile: string, organization_id?: number): Promise<UserData | null> {
22
+
23
+ async findByMobile(mobile: string): Promise<UserData | null> {
27
24
  if (!mobile) return null;
28
-
25
+
29
26
  const where: any = { mobile: mobile };
30
- if (organization_id !== undefined) {
31
- where.organization_id = organization_id;
32
- }
33
-
27
+
34
28
  return this.userRepository.findOne({ where });
35
29
  }
36
-
37
-
38
30
 
39
31
  async saveUser(user: UserData): Promise<UserData> {
40
32
  return this.userRepository.save(user);
@@ -38,16 +38,14 @@ export class UserService extends EntityServiceImpl {
38
38
  ): Promise<BaseEntity> {
39
39
  let userData = entityData as CreateUserDto;
40
40
  let existingUser = await this.userRepository.findByEmailId(
41
- userData.email_id,
42
- userData.organization_id
41
+ userData.email_id
43
42
  );
44
43
  if (existingUser) {
45
44
  throw new BadRequestException('User already exists');
46
45
  }
47
46
 
48
47
  existingUser = await this.userRepository.findByMobile(
49
- userData.mobile,
50
- userData.organization_id
48
+ userData.mobile
51
49
  );
52
50
  if (existingUser) {
53
51
  throw new BadRequestException('User already exists');
@@ -169,11 +167,11 @@ export class UserService extends EntityServiceImpl {
169
167
  }
170
168
 
171
169
 
172
- async findByEmailId(email_id: string,organization_id?: number): Promise<UserData | null> {
173
- return await this.userRepository.findByEmailId(email_id,organization_id);
170
+ async findByEmailId(email_id: string): Promise<UserData | null> {
171
+ return await this.userRepository.findByEmailId(email_id);
174
172
  }
175
173
 
176
- async findByMobile(mobile: string,organization_id: number): Promise<UserData | null> {
177
- return await this.userRepository.findByMobile(mobile,organization_id);
174
+ async findByMobile(mobile: string): Promise<UserData | null> {
175
+ return await this.userRepository.findByMobile(mobile);
178
176
  }
179
177
  }