From 7b333fa2832967c41bef47cbd7d6149ad4ed26c0 Mon Sep 17 00:00:00 2001 From: Emanuel Ramos Date: Thu, 19 Sep 2024 15:36:32 -0300 Subject: [PATCH] feat: add fuzzy param to formatSearch path --- packages/core/src/sdk/search/formatSearchPath.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/sdk/search/formatSearchPath.ts b/packages/core/src/sdk/search/formatSearchPath.ts index d5bbf3125c..e84edc7e85 100644 --- a/packages/core/src/sdk/search/formatSearchPath.ts +++ b/packages/core/src/sdk/search/formatSearchPath.ts @@ -4,14 +4,16 @@ import { formatSearchState, initSearchState } from '@faststore/sdk' type FormatSearchPath = { term: string sort?: SearchState['sort'] + fuzzy?: string } -export const formatSearchPath = ({ term, sort }: FormatSearchPath) => { +export const formatSearchPath = ({ term, sort, fuzzy }: FormatSearchPath) => { const { pathname, search } = formatSearchState( initSearchState({ term, sort, base: '/s', + fuzzy: fuzzy ?? 'auto', }) )