fix(dashboard): create product selected inventory item display (#13111)
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
5
.changeset/smooth-hounds-sip.md
Normal file
5
.changeset/smooth-hounds-sip.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/dashboard": patch
|
||||
---
|
||||
|
||||
fix(dashboard): create product selected inventory item display
|
||||
@@ -31,10 +31,15 @@ function InventoryItemRow({
|
||||
}: InventoryItemRowProps) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const selectedInventoryItemId = useWatch({
|
||||
control: form.control,
|
||||
name: `variants.${variantIndex}.inventory.${inventoryIndex}.inventory_item_id`,
|
||||
})
|
||||
|
||||
const items = useComboboxData({
|
||||
queryKey: ["inventory_items"],
|
||||
defaultValueKey: "id",
|
||||
defaultValue: inventoryItem.inventory_item_id, // prefetch existing inventory items
|
||||
selectedValue: selectedInventoryItemId,
|
||||
queryFn: (params) => sdk.admin.inventoryItem.list(params),
|
||||
getOptions: (data) =>
|
||||
data.inventory_items.map((item) => ({
|
||||
|
||||
Reference in New Issue
Block a user