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/dist/module/meta/service/entity-list.service.js +1 -1
- package/dist/module/meta/service/entity-list.service.js.map +1 -1
- package/dist/module/user/repository/user.repository.d.ts +2 -2
- package/dist/module/user/repository/user.repository.js +2 -8
- package/dist/module/user/repository/user.repository.js.map +1 -1
- package/dist/module/user/service/user.service.d.ts +2 -2
- package/dist/module/user/service/user.service.js +6 -6
- package/dist/module/user/service/user.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/meta/service/entity-list.service.ts +1 -1
- package/src/module/user/repository/user.repository.ts +8 -16
- package/src/module/user/service/user.service.ts +6 -8
package/package.json
CHANGED
|
@@ -9,32 +9,24 @@ export class UserRepository {
|
|
|
9
9
|
@InjectRepository(UserData) private userRepository: Repository<UserData>,
|
|
10
10
|
) {}
|
|
11
11
|
|
|
12
|
-
async findById(userId: number
|
|
12
|
+
async findById(userId: number): Promise<UserData | null> {
|
|
13
13
|
return this.userRepository.findOne({ where: { id: userId } });
|
|
14
14
|
}
|
|
15
|
-
async findByEmailId(email: string
|
|
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
|
-
|
|
20
|
-
where.organization_id = organization_id;
|
|
21
|
-
}
|
|
22
|
-
|
|
19
|
+
|
|
23
20
|
return this.userRepository.findOne({ where });
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
async findByMobile(mobile: string
|
|
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
|
-
|
|
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
|
|
173
|
-
return await this.userRepository.findByEmailId(email_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
|
|
177
|
-
return await this.userRepository.findByMobile(mobile
|
|
174
|
+
async findByMobile(mobile: string): Promise<UserData | null> {
|
|
175
|
+
return await this.userRepository.findByMobile(mobile);
|
|
178
176
|
}
|
|
179
177
|
}
|