From ecf5aeb45c12f2976b97d7d96a986b3c4a76091a Mon Sep 17 00:00:00 2001 From: w3bdesign <45217974+w3bdesign@users.noreply.github.com> Date: Fri, 9 Jun 2023 02:08:35 +0200 Subject: [PATCH 01/10] Refactor --- components/Products/ProductsShowAll.vue | 7 ++++++- layouts/default.vue | 14 +++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/components/Products/ProductsShowAll.vue b/components/Products/ProductsShowAll.vue index 91691370..0039578f 100644 --- a/components/Products/ProductsShowAll.vue +++ b/components/Products/ProductsShowAll.vue @@ -18,7 +18,6 @@ }" > -

{{ product.name }} @@ -84,6 +83,12 @@ const props = defineProps({ const config = useRuntimeConfig(); +/** + * Returns the source URL of a product image or a placeholder image if the product does not have an image. + * + * @param {Object} product - The product object containing the image source URL. + * @return {string} The source URL of the product image or a placeholder image if the product does not have an image. + */ const productImage = (product) => product.image ? product.image.sourceUrl : config.public.placeholderImage; diff --git a/layouts/default.vue b/layouts/default.vue index f4dbce52..b6eedf81 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,12 +1,10 @@