adds ability to update balance to 0 and adds integration test (#1036)
This commit is contained in:
1 parent
12f38ccb72
commit
82ecc7ad24
2 files changed
+31
-1
No files matched your search
@@ -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