update: user me data

This commit is contained in:
Mahyargdz
2025-05-24 15:26:48 +03:30
parent 8bbe821dc8
commit d5ae216784
4 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ export class LoggerService extends Logger {
async sendLogToTelegram(level: string, message: string) {
try {
const logMessage = `🚨 *${level.toUpperCase()} Log:*\n${message}`;
await this.bot.telegram.sendMessage(this.chatId, logMessage, {
await this.bot?.telegram?.sendMessage(this.chatId, logMessage, {
parse_mode: "MarkdownV2",
});
} catch (error) {
+4 -1
View File
@@ -81,7 +81,10 @@ export class UsersService {
/************************************************************ */
async getMe(userId: string) {
const user = await this.userRepository.findOne({ where: { id: userId }, relations: { roles: true } });
const user = await this.userRepository.findOne({
where: { id: userId },
relations: { roles: true, realUser: { address: { city: { province: true } } }, legalUser: { address: { city: { province: true } } } },
});
if (!user) throw new BadRequestException(UserMessage.USER_NOT_FOUND);
return { user };
}