feat(admin-ui, medusa-react): product page categories management + nested multiselect (#3401)
* chore: allow products to be categorized in product create/edit page * refactor: cleanup * feat: invalidate product details cache when categories change * fix: update changesets * fix: push ner changeset * feat: limit popup height --------- Co-authored-by: fPolic <frane@medusajs.com> Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
@@ -37,7 +37,11 @@ export const useAdminCreateProductCategory = (
|
||||
return useMutation(
|
||||
(payload: AdminPostProductCategoriesReq) =>
|
||||
client.admin.productCategories.create(payload),
|
||||
buildOptions(queryClient, [adminProductCategoryKeys.list()], options)
|
||||
buildOptions(
|
||||
queryClient,
|
||||
[adminProductCategoryKeys.list(), adminProductKeys.details()],
|
||||
options
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -63,7 +67,11 @@ export const useAdminUpdateProductCategory = (
|
||||
client.admin.productCategories.update(id, payload),
|
||||
buildOptions(
|
||||
queryClient,
|
||||
[adminProductCategoryKeys.lists(), adminProductCategoryKeys.detail(id)],
|
||||
[
|
||||
adminProductCategoryKeys.lists(),
|
||||
adminProductCategoryKeys.detail(id),
|
||||
adminProductKeys.details(),
|
||||
],
|
||||
options
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user