fix(admin-ui): Create fulfillment (#3607)
* fix for create-fulfillment * remove ff check * add changeset * Disable Create fulfillment button if no quantities fulfilled --------- Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Rares Capilnar <rares.capilnar@gmail.com>
This commit is contained in:
co-authored by
Oliver Windall Juhl
Rares Capilnar
parent
bca1f80dd5
commit
d1a6aa5a90
@@ -1,7 +1,22 @@
|
||||
import { useAdminStockLocations } from "medusa-react"
|
||||
import { useEffect } from "react"
|
||||
import { useFeatureFlag } from "../providers/feature-flag-provider"
|
||||
|
||||
const useStockLocations = () => {
|
||||
const { stock_locations } = useAdminStockLocations()
|
||||
const { isFeatureEnabled } = useFeatureFlag()
|
||||
const isStockLocationsEnabled = isFeatureEnabled("stockLocationService")
|
||||
const { stock_locations, refetch } = useAdminStockLocations(
|
||||
{},
|
||||
{
|
||||
enabled: isStockLocationsEnabled,
|
||||
}
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (isStockLocationsEnabled) {
|
||||
void refetch()
|
||||
}
|
||||
}, [isStockLocationsEnabled, refetch])
|
||||
|
||||
const getLocationNameById = (locationId: string | null) =>
|
||||
stock_locations?.find((stock_location) => stock_location.id === locationId)
|
||||
|
||||
Reference in New Issue
Block a user