Skip to content

Conversation

@sylwia-werner
Copy link
Collaborator

@sylwia-werner sylwia-werner commented Nov 5, 2025

MM2-1473

Note: wait with merge until mercurjs/mercur#453 is merged

@sylwia-werner sylwia-werner requested a review from mikolvj November 5, 2025 13:43
@vercel
Copy link

vercel bot commented Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
admin-panel Ready Ready Preview Comment Nov 12, 2025 9:21am
mercuradmin-development Ready Ready Preview Comment Nov 12, 2025 9:21am
test-admin-panel Ready Ready Preview Comment Nov 12, 2025 9:21am

@sylwia-werner sylwia-werner changed the title MM2 1473: Fix: add force: true for batch inventory item deletion MM2 1473 Fix: set force flag to true for batch inventory item deletion Nov 5, 2025
@sylwia-werner sylwia-werner changed the title MM2 1473 Fix: set force flag to true for batch inventory item deletion MM2 1473 Fix: set force flag to true for batch inventory deletion Nov 5, 2025
Comment on lines 229 to 236
mutationFn: (payload) => {
// force: true is required for admin batch endpoint to delete levels with stocked items
const payloadWithForce: HttpTypes.AdminBatchInventoryItemLocationLevels = {
...payload,
force: payload?.delete?.length ? true : payload.force,
}

return sdk.admin.inventoryItem.batchInventoryItemLocationLevels(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. How about force: !!payload?.delete?.length || payload.force
  2. IMO we don't need to use separate const, we could just
    return sdk.admin.inventoryItem.batchInventoryItemLocationLevels( inventoryItemId, {...payload, force: ....} )

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, refactored

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants