From a1cc9f18c434075c699601c4108e2b274ad25330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=20K=C3=BCng?= Date: Mon, 23 Mar 2026 17:27:18 +0100 Subject: [PATCH 1/2] fix(front-end): fix no index in products --- .../features/shop/product-detail.component.ts | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/features/shop/product-detail.component.ts b/frontend/src/app/features/shop/product-detail.component.ts index 56e01b0..21d5e97 100644 --- a/frontend/src/app/features/shop/product-detail.component.ts +++ b/frontend/src/app/features/shop/product-detail.component.ts @@ -14,7 +14,15 @@ import { import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'; import { Router, RouterLink } from '@angular/router'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { catchError, combineLatest, finalize, of, switchMap, tap } from 'rxjs'; +import { + EMPTY, + catchError, + combineLatest, + finalize, + of, + switchMap, + tap, +} from 'rxjs'; import { SeoService } from '../../core/services/seo.service'; import { LanguageService } from '../../core/services/language.service'; import { findColorHex, getColorHex } from '../../core/constants/colors.const'; @@ -220,7 +228,12 @@ export class ProductDetailComponent { this.modelModalOpen.set(false); }), switchMap(([productSlug]) => { - if (!productSlug) { + if (productSlug === undefined) { + return EMPTY; + } + + const normalizedProductSlug = productSlug.trim(); + if (!normalizedProductSlug) { this.languageService.clearLocalizedRouteOverrides(); this.error.set('SHOP.NOT_FOUND'); this.setResponseStatus(404); @@ -229,7 +242,9 @@ export class ProductDetailComponent { return of(null); } - return this.shopService.getProductByPublicPath(productSlug).pipe( + return this.shopService + .getProductByPublicPath(normalizedProductSlug) + .pipe( catchError((error) => { this.languageService.clearLocalizedRouteOverrides(); this.product.set(null); -- 2.49.1 From 95e60692c0170c7e3357504ac46f128c00f20d40 Mon Sep 17 00:00:00 2001 From: printcalc-ci Date: Mon, 23 Mar 2026 16:31:33 +0000 Subject: [PATCH 2/2] style: apply prettier formatting --- .../features/shop/product-detail.component.ts | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/features/shop/product-detail.component.ts b/frontend/src/app/features/shop/product-detail.component.ts index 21d5e97..2d8423e 100644 --- a/frontend/src/app/features/shop/product-detail.component.ts +++ b/frontend/src/app/features/shop/product-detail.component.ts @@ -245,22 +245,24 @@ export class ProductDetailComponent { return this.shopService .getProductByPublicPath(normalizedProductSlug) .pipe( - catchError((error) => { - this.languageService.clearLocalizedRouteOverrides(); - this.product.set(null); - this.selectedVariantId.set(null); - this.setSelectedImageAssetId(null); - this.modelFile.set(null); - const isNotFound = error?.status === 404; - this.error.set(isNotFound ? 'SHOP.NOT_FOUND' : 'SHOP.LOAD_ERROR'); - this.setResponseStatus(isNotFound ? 404 : 503); - if (this.shouldApplyFallbackSeo(error)) { - this.applyFallbackSeo(); - } - return of(null); - }), - finalize(() => this.loading.set(false)), - ); + catchError((error) => { + this.languageService.clearLocalizedRouteOverrides(); + this.product.set(null); + this.selectedVariantId.set(null); + this.setSelectedImageAssetId(null); + this.modelFile.set(null); + const isNotFound = error?.status === 404; + this.error.set( + isNotFound ? 'SHOP.NOT_FOUND' : 'SHOP.LOAD_ERROR', + ); + this.setResponseStatus(isNotFound ? 404 : 503); + if (this.shouldApplyFallbackSeo(error)) { + this.applyFallbackSeo(); + } + return of(null); + }), + finalize(() => this.loading.set(false)), + ); }), takeUntilDestroyed(this.destroyRef), ) -- 2.49.1