(id: string, updateData: Partial<User>)
| 58 | } |
| 59 | |
| 60 | async update(id: string, updateData: Partial<User>): Promise<User> { |
| 61 | const user = await this.findOne(id); |
| 62 | |
| 63 | if (updateData.password) { |
| 64 | // Use stronger salt rounds (12 instead of 10) for better security |
| 65 | const saltRounds = parseInt(process.env.BCRYPT_SALT_ROUNDS || '12'); |
| 66 | updateData.password = await bcrypt.hash(updateData.password, saltRounds); |
| 67 | } |
| 68 | |
| 69 | Object.assign(user, updateData); |
| 70 | return this.usersRepository.save(user); |
| 71 | } |
| 72 | |
| 73 | async remove(id: string): Promise<void> { |
| 74 | const result = await this.usersRepository.delete(id); |
no test coverage detected