parent
5c986799f0
commit
cda3cfa4c0
1 changed files with 5 additions and 3 deletions
|
@ -165,7 +165,6 @@ export const ProductUpdate: React.FC<ProductUpdateProps> = ({ id, params }) => {
|
|||
productVariantCreateOpts
|
||||
] = useVariantCreateMutation({});
|
||||
|
||||
const { availableChannels, channel } = useAppChannel();
|
||||
const { data, loading, refetch } = useProductDetails({
|
||||
displayLoader: true,
|
||||
variables: {
|
||||
|
@ -173,6 +172,11 @@ export const ProductUpdate: React.FC<ProductUpdateProps> = ({ id, params }) => {
|
|||
firstValues: VALUES_PAGINATE_BY
|
||||
}
|
||||
});
|
||||
|
||||
const isSimpleProduct = !data?.product?.productType?.hasVariants;
|
||||
|
||||
const { availableChannels, channel } = useAppChannel(!isSimpleProduct);
|
||||
|
||||
const limitOpts = useShopLimitsQuery({
|
||||
variables: {
|
||||
productVariants: true
|
||||
|
@ -270,8 +274,6 @@ export const ProductUpdate: React.FC<ProductUpdateProps> = ({ id, params }) => {
|
|||
channel.name.localeCompare(nextChannel.name)
|
||||
);
|
||||
|
||||
const isSimpleProduct = !data?.product?.productType?.hasVariants;
|
||||
|
||||
const {
|
||||
channelsWithVariantsData,
|
||||
haveChannelsWithVariantsDataChanged,
|
||||
|
|
Loading…
Reference in a new issue