Added device layout & filters
Co-authored-by: felix-fx-top <253056634+felix-fx-top@users.noreply.github.com>
This commit is contained in:
parent
db8b488075
commit
821f27ae89
@ -36,11 +36,12 @@ export async function getUserProjects(username = "fxfelixzero") {
|
||||
return callFetchMods({ action: "user_projects", username });
|
||||
}
|
||||
|
||||
export async function searchMods(query: string, offset = 0, limit = 20) {
|
||||
// Sanitize client-side too
|
||||
export async function searchMods(query: string, offset = 0, limit = 20, facets = "") {
|
||||
const cleanQuery = query.slice(0, 200).replace(/[<>{}]/g, "").trim();
|
||||
if (!cleanQuery) return { hits: [], total_hits: 0 };
|
||||
return callFetchMods({ action: "search", query: cleanQuery, offset: String(offset), limit: String(limit) });
|
||||
const params: Record<string, string> = { action: "search", query: cleanQuery, offset: String(offset), limit: String(limit) };
|
||||
if (facets) params.facets = facets;
|
||||
return callFetchMods(params);
|
||||
}
|
||||
|
||||
export async function getProject(id: string) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user