fixed quantity substraction

This commit is contained in:
Kevsl 2024-06-08 10:14:43 +02:00
parent a43064d618
commit 2985f19871

View File

@ -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,
},
});
}