diff --git a/apps/storefront/src/app/[locale]/(main)/search/actions.ts b/apps/storefront/src/app/[locale]/(main)/search/actions.ts index 281ef04..cde8317 100644 --- a/apps/storefront/src/app/[locale]/(main)/search/actions.ts +++ b/apps/storefront/src/app/[locale]/(main)/search/actions.ts @@ -3,6 +3,7 @@ import { DEFAULT_SORT_BY } from "@/config"; import { redirect } from "@/i18n/routing"; import { paths } from "@/lib/paths"; +import { getCurrentRegion } from "@/regions/server"; const passThroughParams = ["sortBy", "limit", "q"] as const; @@ -13,6 +14,8 @@ export const handleFiltersFormSubmit = async ( const formClear = formData.has("clear"); const params = new URLSearchParams(); + const region = await getCurrentRegion(); + formData.forEach((value, key) => { if (key.startsWith("group")) { const [k, v] = key.replace("group", "").split("-"); @@ -45,9 +48,10 @@ export const handleFiltersFormSubmit = async ( } }); - return redirect( - paths.search.asPath({ + return redirect({ + href: paths.search.asPath({ query: Object.fromEntries(params), }), - ); + locale: region.language.locale, + }); }; diff --git a/apps/storefront/src/components/search-product-card.tsx b/apps/storefront/src/components/search-product-card.tsx index e94de6e..9078894 100644 --- a/apps/storefront/src/components/search-product-card.tsx +++ b/apps/storefront/src/components/search-product-card.tsx @@ -6,7 +6,7 @@ import type { PropsWithChildren } from "react"; import type { SearchProduct } from "@nimara/domain/objects/SearchProduct"; -import productPlaceholder from "@/assets/product_placeholder.svg"; +import productPlaceholder from "@/assets/product_placeholder.svg?url"; import { Link } from "@/i18n/routing"; import { useLocalizedFormatter } from "@/lib/formatters/use-localized-formatter"; import { paths } from "@/lib/paths";