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(cart): Shipping methods #6101

Merged
merged 11 commits into from
Jan 18, 2024
Merged

feat(cart): Shipping methods #6101

merged 11 commits into from
Jan 18, 2024

Conversation

olivermrbl
Copy link
Contributor

@olivermrbl olivermrbl commented Jan 16, 2024

jeez, git is a circus at times - messed up again :))

Duplicate of #6075 but with PR comments addressed @adrien2p


What

Add shipping methods

await cartModuleService.addShippingMethods("cart_1234", [{ unit_price: 100 }])
await cartModuleService.addShippingMethods([{ unit_price: 100, cart_id: "cart_1234" }])
await cartModuleService.addShippingMethods({ unit_price: 100, cart_id: "cart_1234" })

Remove shipping methods

await cartModuleService.removeShippingMethods({ provider_id: "manual" })
await cartModuleService.removeShippingMethods("casm_1234")
await cartModuleService.removeShippingMethods(["casm_1234", "casm_4321"])

@olivermrbl olivermrbl requested review from a team as code owners January 16, 2024 18:35
Copy link

changeset-bot bot commented Jan 16, 2024

🦋 Changeset detected

Latest commit: c4f8bdc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@medusajs/types Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Jan 16, 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 Jan 18, 2024 11:16am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Visit Preview Jan 18, 2024 11:16am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Jan 18, 2024 11:16am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Jan 18, 2024 11:16am

@adrien2p
Copy link
Member

😂 aren't you mixing merge and rebase maybe?

@olivermrbl
Copy link
Contributor Author

olivermrbl commented Jan 17, 2024

😂 aren't you mixing merge and rebase maybe?

haha, yes played around with both approaches and messed up my branch big time

@adrien2p
Copy link
Member

In general once you have merged it is not recommended to continue with rebase, cause the merge lost the history and it doesn't play well with rebase

@olivermrbl
Copy link
Contributor Author

In general once you have merged it is not recommended to continue with rebase, cause the merge lost the history and it doesn't play well with rebase

yeah, I was eager to try to make it work, but def. won't be doing this going forward -- too much of a hassle

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.

LGTM 🔥 couple of comments/sugg

packages/cart/src/models/line-item.ts Show resolved Hide resolved
packages/cart/src/models/shipping-method.ts Show resolved Hide resolved
packages/cart/src/repositories/shipping-method.ts Outdated Show resolved Hide resolved
packages/cart/src/services/cart-module.ts Outdated Show resolved Hide resolved
packages/cart/src/services/line-item.ts Outdated Show resolved Hide resolved
packages/cart/src/services/shipping-method.ts Outdated Show resolved Hide resolved
addShippingMethods(
cartId: string,
methods: CreateShippingMethodDTO[],
sharedContext?: Context
Copy link
Member

Choose a reason for hiding this comment

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

suggest: maybe we should remove it from here too? for now?

@olivermrbl olivermrbl merged commit 7f7cb2a into develop Jan 18, 2024
11 checks passed
@kodiakhq kodiakhq bot deleted the feat/cart-module-sm branch January 18, 2024 11:16
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.

2 participants