fix(storefront+TPV): storefront live search proxy, product expiry/weight display, TPV receipt popup timestamp
This commit is contained in:
@@ -53,6 +53,8 @@ export interface ProductSummaryDto {
|
||||
seoDescription: string | null;
|
||||
categoryIds: string[];
|
||||
brandId: string | null;
|
||||
expirationDate?: string | null;
|
||||
unitWeightKg?: number | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -79,7 +81,11 @@ export interface SearchProductsInput {
|
||||
|
||||
// Use env var if set, otherwise use relative URL (works for SSR and client-side via same-origin)
|
||||
function apiBaseUrl(): string {
|
||||
const base = process.env.API_BASE_URL ?? process.env.NEXT_PUBLIC_API_BASE_URL ?? '';
|
||||
// Browser: use same-origin proxy to avoid network/IP issues
|
||||
// SSR: use backend URL directly
|
||||
const base = (typeof window !== 'undefined')
|
||||
? '/api/catalog-proxy'
|
||||
: (process.env.API_BASE_URL ?? process.env.NEXT_PUBLIC_API_BASE_URL ?? 'http://127.0.0.1:3000');
|
||||
return base.replace(/\/$/, '');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user