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(region): Region create, delete, update admin endpoints #6332

Merged
merged 15 commits into from
Feb 20, 2024

Conversation

olivermrbl
Copy link
Contributor

@olivermrbl olivermrbl commented Feb 6, 2024

What
Add POST /admin/regions
Add POST /admin/regions/:id
Add DELETE /admin/regions/:id

All are added for v2 using API Routes and workflows.

In follow-up PRs, I will add support for passing countries in update and create.

Update: First follow-up PR is #6372

Copy link

changeset-bot bot commented Feb 6, 2024

⚠️ No Changeset found

Latest commit: 185d5e1

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

Copy link

vercel bot commented Feb 6, 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 Feb 20, 2024 9:56am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Feb 20, 2024 9:56am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Feb 20, 2024 9:56am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Feb 20, 2024 9:56am

@olivermrbl olivermrbl requested review from adrien2p and a team February 16, 2024 13:34
@olivermrbl
Copy link
Contributor Author

olivermrbl commented Feb 19, 2024

@medusajs/engineering, this one is longing for a review 😄

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, few todo's left

Comment on lines +23 to +25
defaultFields: defaultAdminRegionFields,
defaultRelations: defaultAdminRegionRelations,
allowedRelations: allowedAdminRegionRelations,
Copy link
Member

Choose a reason for hiding this comment

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

suggestion(nit): we could just have defaultAdminRegionFields which already include the relations. In the route (for now but in the middleware would be better) we can use the util to get the select and relations from the fields. wdyt? Just in order to start the cleanup and not have to maintain two array etc and facilitate the migration later

@kodiakhq kodiakhq bot merged commit 691f68c into develop Feb 20, 2024
17 checks passed
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.

4 participants