mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2025-07-09 06: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,
|
||||
},
|
||||
});
|
||||
const newQuantity = (crypto.quantity -= 1);
|
||||
return this.prisma.crypto.update({
|
||||
where: {
|
||||
id: dto.id_crypto,
|
||||
},
|
||||
data: {
|
||||
value: newCryptoValue,
|
||||
quantity: newQuantity,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user