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