Skip to content

Commit

Permalink
fix(admin-ui): Undefined vars in admin (medusajs#5162)
Browse files Browse the repository at this point in the history
* fix(admin-ui): Undefined vars in admin

* Create short-hairs-fold.md
  • Loading branch information
olivermrbl authored Sep 20, 2023
1 parent 54531e3 commit ef2a12e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/short-hairs-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@medusajs/admin-ui": patch
"@medusajs/admin": patch
---

fix(admin-ui): Undefined vars in admin
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export const EditConditionProvider = ({
}

export const useEditConditionContext = () => {
const { t } = useTranslation()
const context = useContext(EditConditionContext)
if (context === null) {
throw new Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ef2a12e

Please sign in to comment.