adds ability to update balance to 0 and adds integration test (#1036)
This commit is contained in:
@@ -261,7 +261,7 @@ class GiftCardService extends BaseService {
|
||||
giftCard.metadata = await this.setMetadata_(giftCard.id, metadata)
|
||||
}
|
||||
|
||||
if (balance) {
|
||||
if (typeof balance !== "undefined") {
|
||||
if (balance < 0 || giftCard.value < balance) {
|
||||
throw new MedusaError(
|
||||
MedusaError.Types.INVALID_ARGUMENT,
|
||||
|
||||
Reference in New Issue
Block a user