MCPcopy Create free account
hub / github.com/Datakitpage/Datakit / update

Method update

backend/api/src/users/users.service.ts:60–71  ·  view source on GitHub ↗
(id: string, updateData: Partial<User>)

Source from the content-addressed store, hash-verified

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);

Callers 7

updateProfileMethod · 0.45
revokeTokenMethod · 0.45
revokeAllUserTokensMethod · 0.45
encryptPasswordMethod · 0.45
decryptPasswordMethod · 0.45
hashSHA256Method · 0.45

Calls 1

findOneMethod · 0.95

Tested by

no test coverage detected