Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core-flows): Use remote link methods to dismiss all links related to inventory item #6737

Merged
merged 6 commits into from
Mar 22, 2024

Conversation

pKorsholm
Copy link
Contributor

What

  • use remoteLink.delete to dismiss all connections to inventory_item_id

@pKorsholm pKorsholm requested a review from a team as a code owner March 19, 2024 12:29
Copy link

changeset-bot bot commented Mar 19, 2024

⚠️ No Changeset found

Latest commit: b9d2e37

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pKorsholm pKorsholm requested a review from adrien2p March 19, 2024 12:29
Copy link

vercel bot commented Mar 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 22, 2024 9:46am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Mar 22, 2024 9:46am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Mar 22, 2024 9:46am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Mar 22, 2024 9:46am

@carlos-r-l-rodrigues
Copy link
Contributor

I think we can rename that file and the step to refer to deletion as well, because in theory you can still have a place where you just want to call a detach and that would be your current step.

@adrien2p
Copy link
Member

Should we also check that the link configurations include the cascade option?

Cc @carlos-r-l-rodrigues

Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

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

Do we have tests to validate the deletions of the links with multiple levels or links?

Copy link
Contributor

@riqwan riqwan left a comment

Choose a reason for hiding this comment

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

one suggestion, but lgtm!

Modules.INVENTORY,
"inventory_item_id"
)
await remoteLink.delete({
Copy link
Contributor

Choose a reason for hiding this comment

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

oh cool, didn't know this does a soft delete. Would be good to have a test that checks this.

Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: don't have to do this now, but I wonder if we can do a generic deleteLinkStep() that accepts an object. Something like this:

deleteLinkStep({
  [Modules.INVENTORY]: { inventory_item_id: data.ids },
})

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

Copy link
Contributor

Choose a reason for hiding this comment

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

@carlos-r-l-rodrigues
Copy link
Contributor

Should we also check that the link configurations include the cascade option?

Cc @carlos-r-l-rodrigues

Yeah, I think so. But I'm not sure if we have one yet. Maybe the link between product variant and inventory item?

@adrien2p
Copy link
Member

Should we also check that the link configurations include the cascade option?
Cc @carlos-r-l-rodrigues

Yeah, I think so. But I'm not sure if we have one yet. Maybe the link between product variant and inventory item?

Yeah something like that, or cart -> sales_channel -> fulfillment too

@olivermrbl olivermrbl merged commit 3e85f4d into develop Mar 22, 2024
18 checks passed
@olivermrbl olivermrbl deleted the feat/use-link-module-delete-for-deatach branch March 22, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants