diff --git a/storefront/app/components/base/header/index.vue b/storefront/app/components/base/header/index.vue index d94bf31f..0563784c 100644 --- a/storefront/app/components/base/header/index.vue +++ b/storefront/app/components/base/header/index.vue @@ -18,35 +18,35 @@ {{ t('header.nav.shop') }} {{ t('header.nav.catalog') }} {{ t('header.nav.brands') }} {{ t('header.nav.blog') }} {{ t('header.nav.contact') }} diff --git a/storefront/app/components/ui/title.vue b/storefront/app/components/ui/title.vue index 8a90db41..db151184 100644 --- a/storefront/app/components/ui/title.vue +++ b/storefront/app/components/ui/title.vue @@ -40,7 +40,7 @@ font-weight: 400; letter-spacing: -0.5px; } -:deep(.title__wrapper div) { +:deep(.title__wrapper .search) { position: relative; & span { diff --git a/storefront/app/composables/brands/useBrandBySlug.ts b/storefront/app/composables/brands/useBrandBySlug.ts index cba9b4da..7dd0cc65 100644 --- a/storefront/app/composables/brands/useBrandBySlug.ts +++ b/storefront/app/composables/brands/useBrandBySlug.ts @@ -8,6 +8,14 @@ export async function useBrandBySlug(slug: string) { slug, }); + if (!data.value?.brands?.edges?.length) { + throw createError({ + status: 404, + statusText: 'Brand not found', + fatal: true + }); + } + watch(error, (err) => { if (err) { console.error('useBrandsBySlug error:', err); diff --git a/storefront/app/composables/categories/useCategoryBySlug.ts b/storefront/app/composables/categories/useCategoryBySlug.ts index 27bacfcb..0a30c961 100644 --- a/storefront/app/composables/categories/useCategoryBySlug.ts +++ b/storefront/app/composables/categories/useCategoryBySlug.ts @@ -13,6 +13,14 @@ export async function useCategoryBySlug(slug: string) { }); const minMaxPrices = computed(() => category.value?.minMaxPrices ?? { minPrice: 0, maxPrice: 50000 }); + if (!data.value?.categories?.edges?.length) { + throw createError({ + status: 404, + statusText: 'Category not found', + fatal: true + }); + } + watch(error, (err) => { if (err) { console.error('useCategoryBySlug error:', err); diff --git a/storefront/app/composables/products/useProductBySlug.ts b/storefront/app/composables/products/useProductBySlug.ts index f30a1af0..ea2f6aa9 100644 --- a/storefront/app/composables/products/useProductBySlug.ts +++ b/storefront/app/composables/products/useProductBySlug.ts @@ -13,6 +13,14 @@ export async function useProductBySlug(slug: string) { product.value = result; } + if (!data.value?.products?.edges?.length) { + throw createError({ + status: 404, + statusText: 'Product not found', + fatal: true + }); + } + watch(error, (err) => { if (err) { console.error('useProductBySlug error:', err); diff --git a/storefront/app/error.vue b/storefront/app/error.vue new file mode 100644 index 00000000..69b79a55 --- /dev/null +++ b/storefront/app/error.vue @@ -0,0 +1,82 @@ + + + + + \ No newline at end of file diff --git a/storefront/app/pages/brand/[brandSlug].vue b/storefront/app/pages/brand/[brandSlug].vue index 7e0bee76..4947516c 100644 --- a/storefront/app/pages/brand/[brandSlug].vue +++ b/storefront/app/pages/brand/[brandSlug].vue @@ -9,7 +9,7 @@ :alt="brand.name" />

{{ brand.name }}

-

{{ brand.description }}

+
diff --git a/storefront/app/pages/brands.vue b/storefront/app/pages/brands.vue index fab39de9..30c4e064 100644 --- a/storefront/app/pages/brands.vue +++ b/storefront/app/pages/brands.vue @@ -3,7 +3,7 @@

{{ t('brands.title') }}

{{ t('brands.text') }}

-