🚀 Phase 3 Complete: Fix staff list, PDF preview, and functional Settings/Profile
This commit is contained in:
@@ -71,4 +71,21 @@ export class UsersService {
|
||||
const user = await this.findOne(tenantId, id);
|
||||
await this.userRepository.update(id, { is_active: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* تحديث بيانات مستخدم
|
||||
*/
|
||||
async update(id: string, dto: any): Promise<User> {
|
||||
const user = await this.userRepository.findOne({ where: { id } });
|
||||
if (!user) throw new NotFoundException('User not found');
|
||||
|
||||
// Hash password if provided
|
||||
if (dto.password) {
|
||||
dto.password_hash = await bcrypt.hash(dto.password, 12);
|
||||
delete dto.password;
|
||||
}
|
||||
|
||||
Object.assign(user, dto);
|
||||
return this.userRepository.save(user);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user