This commit is contained in:
2025-07-25 17:30:34 +09:00
parent a3f591ab3a
commit 3864eaa965
30 changed files with 241 additions and 63 deletions

View File

@@ -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([