fix(admin-ui): Undefined vars in admin (#5162)
* fix(admin-ui): Undefined vars in admin * Create short-hairs-fold.md
This commit is contained in:
6
.changeset/short-hairs-fold.md
Normal file
6
.changeset/short-hairs-fold.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/admin-ui": patch
|
||||
"@medusajs/admin": patch
|
||||
---
|
||||
|
||||
fix(admin-ui): Undefined vars in admin
|
||||
@@ -12,7 +12,7 @@ import { useDebounce } from "../../../hooks/use-debounce"
|
||||
import { useState } from "react"
|
||||
|
||||
type Props = {
|
||||
onItemSelect: (item: itemType) => void
|
||||
onItemSelect: (item: DecoratedInventoryItemDTO) => void
|
||||
clearOnSelect?: boolean
|
||||
filters?: AdminGetInventoryItemsParams
|
||||
}
|
||||
|
||||
@@ -243,6 +243,7 @@ function CustomerGroupDetailsHeader(props: CustomerGroupDetailsHeaderProps) {
|
||||
*/
|
||||
function CustomerGroupDetails() {
|
||||
const { id } = useParams()
|
||||
const { t } = useTranslation()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const { customer_group, isLoading, error } = useAdminCustomerGroup(id!)
|
||||
|
||||
@@ -134,6 +134,7 @@ export const EditConditionProvider = ({
|
||||
}
|
||||
|
||||
export const useEditConditionContext = () => {
|
||||
const { t } = useTranslation()
|
||||
const context = useContext(EditConditionContext)
|
||||
if (context === null) {
|
||||
throw new Error(
|
||||
|
||||
@@ -52,14 +52,14 @@ const EditReservationDrawer = ({
|
||||
const form = useForm<EditReservationLineItemForm>({
|
||||
defaultValues: {
|
||||
item: {
|
||||
description: reservation - description,
|
||||
description: reservation.description,
|
||||
},
|
||||
metadata: getMetadataFormValues(reservation?.metadata),
|
||||
},
|
||||
})
|
||||
|
||||
const { state: hasMetadata, toggle: toggleHasMetadata } = useToggleState(
|
||||
!!reservation - metadata
|
||||
!!reservation.metadata
|
||||
)
|
||||
|
||||
const { control, setValue, handleSubmit, register } = form
|
||||
@@ -124,7 +124,7 @@ const EditReservationDrawer = ({
|
||||
useEffect(() => {
|
||||
if (stock_locations?.length && reservation) {
|
||||
const defaultLocation = stock_locations.find(
|
||||
(sl: StockLocationDTO) => sl.id === reservation - location_id
|
||||
(sl: StockLocationDTO) => sl.id === reservation.location_id
|
||||
)
|
||||
|
||||
if (defaultLocation) {
|
||||
|
||||
Reference in New Issue
Block a user