be 1:1
This commit is contained in:
14
backend/dist/users/users.service.js
vendored
14
backend/dist/users/users.service.js
vendored
@@ -60,6 +60,20 @@ let UsersService = class UsersService {
|
||||
email: user.email,
|
||||
};
|
||||
}
|
||||
async findUserWithProfileByIdOrFail(id) {
|
||||
const user = await this.repo.findOne({ where: { id }, relations: ['profile'] });
|
||||
if (!user)
|
||||
throw new common_1.NotFoundException('User not found');
|
||||
return {
|
||||
id: user.id,
|
||||
name: user.name,
|
||||
email: user.email,
|
||||
profile: {
|
||||
bio: user.profile?.bio,
|
||||
avatarUrl: user.profile?.avatarUrl,
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.UsersService = UsersService;
|
||||
exports.UsersService = UsersService = __decorate([
|
||||
|
Reference in New Issue
Block a user