mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2025-07-08 21:50:13 +02:00
fixed get my assets
This commit is contained in:
parent
93f86101b7
commit
84bfac8a98
@ -27,6 +27,7 @@ export class AuthService {
|
||||
name: 'user',
|
||||
},
|
||||
});
|
||||
|
||||
let balance = 1000;
|
||||
if (promoCode && promoCode.value) {
|
||||
balance = promoCode.value;
|
||||
|
@ -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 }],
|
||||
|
Loading…
x
Reference in New Issue
Block a user