Skip to content

Commit

Permalink
Merge pull request #3 from aiworksla/SHR-1933
Browse files Browse the repository at this point in the history
Shr 1933
  • Loading branch information
aliammar001 authored Jun 5, 2023
2 parents 8ddde2c + eab4691 commit cc419b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const MultiAutocompleteSelectFieldComponent: React.FC<MultiAutocompleteSelectFie
if (fetchOnFocus) {
fetchChoices(inputValue);
}
input.current.select();
input?.current?.select();
};

const handleToggleMenu = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const ProductUpdatePage: React.FC<ProductUpdatePageProps> = ({
);

const [selectedTaxType, setSelectedTaxType] = useStateFromProps(
product?.taxType.description,
product?.taxType?.description,
);

const categories = getChoices(categoryChoiceList);
Expand Down
8 changes: 4 additions & 4 deletions src/products/utils/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ export function getProductUpdatePageFormData(

return {
category: maybe(() => product.category.id, ""),
changeTaxCode: !!product?.taxType.taxCode,
chargeTaxes: maybe(() => product.chargeTaxes, false),
changeTaxCode: !!product?.taxType?.taxCode,
chargeTaxes: maybe(() => product?.chargeTaxes, false),
collections: maybe(
() => product.collections.map(collection => collection.id),
() => product?.collections?.map(collection => collection.id),
[],
),
isAvailable: !!product?.isAvailable,
Expand All @@ -224,7 +224,7 @@ export function getProductUpdatePageFormData(
"",
),
slug: product?.slug || "",
taxCode: product?.taxType.taxCode,
taxCode: product?.taxType?.taxCode,
trackInventory: !!variant?.trackInventory,
weight: product?.weight?.value.toString() || "",
isPreorder: !!variant?.preorder || false,
Expand Down

0 comments on commit cc419b5

Please sign in to comment.