Skip to content

Commit

Permalink
fix: remove check for variations or variation master data for variati…
Browse files Browse the repository at this point in the history
…on product data handling

- with these madatory checks `0` is returned as product view data if no variations are available for whatever reason
- it seems better to return at least the available standard product data instead of nothing
- prevents loading animations for variation/master product tiles that for some reason have no variations but the basic product data
  • Loading branch information
shauke committed Dec 3, 2022
1 parent 9964ebd commit 41e674f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/app/core/models/product-view/product-view.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ export function createVariationProductMasterView(
defaultCategory?: CategoryView
): VariationProductMasterView {
return (
product &&
variations?.length && {
product && {
...createProductView(product, defaultCategory),
type: 'VariationProductMaster',
defaultVariationSKU,
Expand All @@ -54,9 +53,7 @@ export function createVariationProductView(
defaultCategory?: CategoryView
): VariationProductView {
return (
product &&
productMaster &&
variations?.length && {
product && {
...createProductView(product, defaultCategory),
type: 'VariationProduct',
variations,
Expand Down

0 comments on commit 41e674f

Please sign in to comment.