Skip to content

Commit

Permalink
added trim
Browse files Browse the repository at this point in the history
  • Loading branch information
MeesoPost authored and AliKdhim87 committed May 21, 2024
1 parent 635aa4a commit 9c53e4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/pdc-frontend/src/app/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ export const getSuggestedSearch = async (
export const onSearchSubmitAction = async (formData: FormData, locale: string) => {
const value = formData.get('search') as string;
const result = await getSuggestedSearch(value, locale);
if (result?.total) {
if (result?.total && value.trim()) {
redirect(`/${locale}/search/${value}`);
}
redirect(`/${locale}/search/tips?query=`);
};

export const getLiveSuggestions = async (value: string) => {
Expand Down

0 comments on commit 9c53e4a

Please sign in to comment.