diff --git a/src/crypto/crypto.service.ts b/src/crypto/crypto.service.ts index 8d0242d..ebbb15d 100644 --- a/src/crypto/crypto.service.ts +++ b/src/crypto/crypto.service.ts @@ -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, }, }); }