From 84bfac8a989d557ed0b9d34e22b5a9ad65710c55 Mon Sep 17 00:00:00 2001 From: Kevsl Date: Fri, 7 Jun 2024 12:18:21 +0200 Subject: [PATCH] fixed get my assets --- src/auth/auth.service.ts | 1 + src/user/user.service.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index bf8291e..ac2402a 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -27,6 +27,7 @@ export class AuthService { name: 'user', }, }); + let balance = 1000; if (promoCode && promoCode.value) { balance = promoCode.value; diff --git a/src/user/user.service.ts b/src/user/user.service.ts index a6c86fc..519d7ba 100644 --- a/src/user/user.service.ts +++ b/src/user/user.service.ts @@ -1,11 +1,14 @@ import { Injectable } from '@nestjs/common'; import { PrismaService } from '../prisma/prisma.service'; +import { checkUserHasAccount } from 'src/utils/checkUser'; @Injectable() export class UserService { constructor(private prisma: PrismaService) {} async GetMyAssets(userId: string) { + await checkUserHasAccount(userId); + const user = await this.prisma.user.findUnique({ where: { id: userId, @@ -18,6 +21,7 @@ export class UserService { } async GetMyTrades(userId: string) { + await checkUserHasAccount(userId); const user = await this.prisma.trade.findMany({ where: { OR: [{ id_giver: userId }, { id_receiver: userId }],