mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2025-07-09 14:00:12 +02:00
added token sell to bank
This commit is contained in:
parent
b89065e5c6
commit
7f00cfb382
@ -84,7 +84,7 @@ export class CryptoService {
|
|||||||
|
|
||||||
const newBalance = userAsset.amount - dto.amount;
|
const newBalance = userAsset.amount - dto.amount;
|
||||||
if (newBalance > 0) {
|
if (newBalance > 0) {
|
||||||
await this.prisma.userHasCrypto.update({
|
return this.prisma.userHasCrypto.update({
|
||||||
where: {
|
where: {
|
||||||
id: userAsset.id,
|
id: userAsset.id,
|
||||||
},
|
},
|
||||||
@ -93,7 +93,7 @@ export class CryptoService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await this.prisma.userHasCrypto.delete({
|
return this.prisma.userHasCrypto.delete({
|
||||||
where: {
|
where: {
|
||||||
id: userAsset.id,
|
id: userAsset.id,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user