mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2025-07-09 14:00:12 +02:00
fixed quantity substraction
This commit is contained in:
parent
a43064d618
commit
2985f19871
@ -130,12 +130,14 @@ export class CryptoService {
|
|||||||
value: newCryptoValue,
|
value: newCryptoValue,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const newQuantity = (crypto.quantity -= 1);
|
||||||
return this.prisma.crypto.update({
|
return this.prisma.crypto.update({
|
||||||
where: {
|
where: {
|
||||||
id: dto.id_crypto,
|
id: dto.id_crypto,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
value: newCryptoValue,
|
value: newCryptoValue,
|
||||||
|
quantity: newQuantity,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user