fix(dashboard, fulfilment): fulfilment providers enabled check (#9415)
**What** - hide disabled fulfilment providers on the admin - check if the fulfilment provider has an identifier when loading providers --- FIXES CC-549
This commit is contained in:
@@ -20,6 +20,7 @@ function LocationsFulfillmentProvidersSection({
|
||||
const { fulfillment_providers } = useFulfillmentProviders({
|
||||
stock_location_id: location.id,
|
||||
fields: "id",
|
||||
is_enabled: true,
|
||||
})
|
||||
|
||||
return (
|
||||
|
||||
@@ -69,7 +69,7 @@ export const LocationEditFulfillmentProvidersForm = ({
|
||||
|
||||
const { fulfillment_providers, count, isLoading, isError, error } =
|
||||
useFulfillmentProviders(
|
||||
{ ...searchParams },
|
||||
{ ...searchParams, is_enabled: true },
|
||||
{ placeholderData: keepPreviousData }
|
||||
)
|
||||
|
||||
|
||||
@@ -6,12 +6,10 @@ import { LocationEditFulfillmentProvidersForm } from "./components/edit-fulfillm
|
||||
|
||||
export const LocationFulfillmentProviders = () => {
|
||||
const { location_id } = useParams()
|
||||
const { stock_location, isPending, isError, error } = useStockLocation(
|
||||
location_id!,
|
||||
{ fields: "id,*fulfillment_providers" }
|
||||
)
|
||||
const { stock_location, isPending, isFetching, isError, error } =
|
||||
useStockLocation(location_id!, { fields: "id,*fulfillment_providers" })
|
||||
|
||||
const ready = !isPending && !!stock_location
|
||||
const ready = !isPending && !isFetching && !!stock_location
|
||||
|
||||
if (isError) {
|
||||
throw error
|
||||
|
||||
@@ -10,7 +10,9 @@ export const RegionCreate = () => {
|
||||
const storeCurrencies = (store?.supported_currencies ?? []).map(
|
||||
(c) => currencies[c.currency_code.toUpperCase()]
|
||||
)
|
||||
const { payment_providers: paymentProviders = [] } = usePaymentProviders()
|
||||
const { payment_providers: paymentProviders = [] } = usePaymentProviders({
|
||||
is_enabled: true,
|
||||
})
|
||||
|
||||
if (isError) {
|
||||
throw error
|
||||
|
||||
@@ -50,6 +50,7 @@ export const RegionEdit = () => {
|
||||
)
|
||||
const { payment_providers: paymentProviders = [] } = usePaymentProviders({
|
||||
limit: 999,
|
||||
is_enabled: true,
|
||||
})
|
||||
|
||||
if (isRegionError) {
|
||||
|
||||
Reference in New Issue
Block a user