Skip to content

Commit

Permalink
fix: do not set inventory on stock import with one deposit only
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Jan 22, 2025
1 parent f055a76 commit c8ef595
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions/lib/integration/import-product.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ module.exports = ({ appSdk, storeId, auth }, blingToken, blingStore, blingDeposi
}
console.log(`#${storeId} ${resourceAndId}`, { quantity, inventory, sku })
if (Object.keys(inventory).length) {
if (quantity > 0 && (!inventoryQnt || Object.keys(inventory).length === 1)) {
if ((quantity > 0 && !inventoryQnt) || Object.keys(inventory).length === 1) {
inventory = {}
}
const endpoint = `${resourceAndId}.json`
Expand Down

0 comments on commit c8ef595

Please sign in to comment.