-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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(medusa): added admin create endpoint for nested categories #2985
Conversation
🦋 Changeset detectedLatest commit: bbc0b3e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
b0dd13e
to
0357518
Compare
0357518
to
d8d59f6
Compare
packages/medusa/src/api/routes/admin/product-categories/create-product-category.ts
Outdated
Show resolved
Hide resolved
packages/medusa/src/api/routes/admin/product-categories/create-product-category.ts
Outdated
Show resolved
Hide resolved
packages/medusa/src/api/routes/admin/product-categories/create-product-category.ts
Outdated
Show resolved
Hide resolved
packages/medusa/src/api/routes/admin/product-categories/create-product-category.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (not duplicating comments)
one question: should we add events for creation/updates(updation?)/deletion as well?
this could easily be a future pr, so definitely non-blocking as of now 😄
7311999
to
98d2f93
Compare
@adrien2p Will you revisit your review, so we can merge? :) |
@@ -41,14 +42,18 @@ export class ProductCategory extends SoftDeletableEntity { | |||
|
|||
// Typeorm also keeps track of the category's parent at all times. | |||
@Column() | |||
parent_category_id: ProductCategory | |||
parent_category_id: string | null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch 🙏
|
||
const api = useApi() | ||
|
||
const response = await api.post( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non blocking: should we add a tests without passing the handle to also assert that this behaviour do not broke at some point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nonblocking suggestion
What:
Introduces an admin endpoint that allows a user to create a product category
Why:
This is part of a greater goal of allowing products to be added to multiple categories.
How:
RESOLVES CORE-958