fix(front-end): fix no index in products #53
@@ -245,22 +245,24 @@ export class ProductDetailComponent {
|
|||||||
return this.shopService
|
return this.shopService
|
||||||
.getProductByPublicPath(normalizedProductSlug)
|
.getProductByPublicPath(normalizedProductSlug)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError((error) => {
|
catchError((error) => {
|
||||||
this.languageService.clearLocalizedRouteOverrides();
|
this.languageService.clearLocalizedRouteOverrides();
|
||||||
this.product.set(null);
|
this.product.set(null);
|
||||||
this.selectedVariantId.set(null);
|
this.selectedVariantId.set(null);
|
||||||
this.setSelectedImageAssetId(null);
|
this.setSelectedImageAssetId(null);
|
||||||
this.modelFile.set(null);
|
this.modelFile.set(null);
|
||||||
const isNotFound = error?.status === 404;
|
const isNotFound = error?.status === 404;
|
||||||
this.error.set(isNotFound ? 'SHOP.NOT_FOUND' : 'SHOP.LOAD_ERROR');
|
this.error.set(
|
||||||
this.setResponseStatus(isNotFound ? 404 : 503);
|
isNotFound ? 'SHOP.NOT_FOUND' : 'SHOP.LOAD_ERROR',
|
||||||
if (this.shouldApplyFallbackSeo(error)) {
|
);
|
||||||
this.applyFallbackSeo();
|
this.setResponseStatus(isNotFound ? 404 : 503);
|
||||||
}
|
if (this.shouldApplyFallbackSeo(error)) {
|
||||||
return of(null);
|
this.applyFallbackSeo();
|
||||||
}),
|
}
|
||||||
finalize(() => this.loading.set(false)),
|
return of(null);
|
||||||
);
|
}),
|
||||||
|
finalize(() => this.loading.set(false)),
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
takeUntilDestroyed(this.destroyRef),
|
takeUntilDestroyed(this.destroyRef),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user