fix(admin-ui): Add guard for null product_id (#3894)
* handle null variants differently * add changeset
This commit is contained in:
1 parent
86613a5190
commit
d302db2397
2 files changed
+7
-4
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/admin-ui": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(admin): add guard for null variant in inventory overview
|
||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
useAdminUpdateLocationLevel,
|
useAdminUpdateLocationLevel,
|
||||||
useAdminVariant,
|
useAdminVariant,
|
||||||
} from "medusa-react"
|
} from "medusa-react"
|
||||||
|
import { useLocation, useNavigate } from "react-router-dom"
|
||||||
|
|
||||||
import Button from "../../fundamentals/button"
|
import Button from "../../fundamentals/button"
|
||||||
import ImagePlaceholder from "../../fundamentals/image-placeholder"
|
import ImagePlaceholder from "../../fundamentals/image-placeholder"
|
||||||
@@ -27,7 +28,6 @@ import { isEmpty } from "lodash"
|
|||||||
import qs from "qs"
|
import qs from "qs"
|
||||||
import { useInventoryFilters } from "./use-inventory-filters"
|
import { useInventoryFilters } from "./use-inventory-filters"
|
||||||
import useInventoryTableColumn from "./use-inventory-column"
|
import useInventoryTableColumn from "./use-inventory-column"
|
||||||
import { useLocation, useNavigate } from "react-router-dom"
|
|
||||||
import useNotification from "../../../hooks/use-notification"
|
import useNotification from "../../../hooks/use-notification"
|
||||||
import useToggleState from "../../../hooks/use-toggle-state"
|
import useToggleState from "../../../hooks/use-toggle-state"
|
||||||
|
|
||||||
@@ -306,9 +306,7 @@ const InventoryRow = ({
|
|||||||
} = useToggleState()
|
} = useToggleState()
|
||||||
|
|
||||||
const getRowActionables = () => {
|
const getRowActionables = () => {
|
||||||
const productId = inventory.variants?.length
|
const productId = inventory.variants?.[0]?.product_id
|
||||||
? inventory.variants[0].product_id
|
|
||||||
: null
|
|
||||||
|
|
||||||
const actions = [
|
const actions = [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user