feat(product-detail): implement resolver for product details and update component logic for improved error handling
feat(product-carousel): enhance image loading with optimized attributes and improve layout consistency style: refactor HTML structure for better readability and maintainability test(product-detail): add unit tests for product detail resolver and component behavior
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { HttpRequest, provideHttpClient, withFetch, withInterceptors } from '@angular/common/http';
|
||||
import { ApplicationConfig, provideAppInitializer, provideBrowserGlobalErrorListeners } from '@angular/core';
|
||||
import {
|
||||
ApplicationConfig,
|
||||
provideAppInitializer,
|
||||
provideBrowserGlobalErrorListeners,
|
||||
} from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideClientHydration, withHttpTransferCacheOptions } from '@angular/platform-browser';
|
||||
|
||||
@@ -8,10 +12,10 @@ import { authBootstrap } from './core/services/auth/auth-bootstrap';
|
||||
import { authInterceptor } from './core/services/auth/auth.interceptor';
|
||||
import { tenantBootstrap } from './core/services/tenant-bootstrap';
|
||||
|
||||
function isStoreHomeProductsRequest(request: HttpRequest<unknown>): boolean {
|
||||
function isStoreCatalogRequest(request: HttpRequest<unknown>): boolean {
|
||||
return (
|
||||
request.method === 'GET' &&
|
||||
/\/api\/tenants\/[^/]+\/productos(?:\?|$)/.test(request.urlWithParams)
|
||||
/\/api\/tenants\/[^/]+\/productos(?:\/\d+)?(?:\?|$)/.test(request.urlWithParams)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -22,11 +26,11 @@ export const appConfig: ApplicationConfig = {
|
||||
provideClientHydration(
|
||||
withHttpTransferCacheOptions({
|
||||
includeRequestsWithAuthHeaders: true,
|
||||
filter: isStoreHomeProductsRequest
|
||||
})
|
||||
filter: isStoreCatalogRequest,
|
||||
}),
|
||||
),
|
||||
provideHttpClient(withFetch(), withInterceptors([authInterceptor])),
|
||||
provideAppInitializer(authBootstrap),
|
||||
provideAppInitializer(tenantBootstrap)
|
||||
]
|
||||
provideAppInitializer(tenantBootstrap),
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user