Skip to content

Commit dff8929

Browse files
committed
clean up
1 parent 6c58a9d commit dff8929

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

src/components/api/searchApi.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import axiosInstance from "@/config/axios-config";
2-
import { LANGUAGE } from "@/lib/constant";
32

43
type SearchCommon = {
54
query: string;
@@ -8,22 +7,7 @@ type SearchCommon = {
87
skip?: number;
98
};
109

11-
const normalizeLanguageForApi = (language?: string | null) => {
12-
if (!language) return "en";
13-
const lower = language.toLowerCase();
14-
if (lower.startsWith("en")) return "en";
15-
if (lower.startsWith("bo")) return "bo";
16-
if (lower.startsWith("zh")) return "zh";
17-
return "en";
18-
};
1910

20-
const pickSearchLanguage = (query: string, uiLanguage?: string | null) => {
21-
const normalized = normalizeLanguageForApi(uiLanguage);
22-
if (/[A-Za-z]/.test(query) && normalized !== "en") {
23-
return "en";
24-
}
25-
return normalized;
26-
};
2711

2812
export const searchSources = async ({
2913
query,

0 commit comments

Comments
 (0)