This commit is contained in:
Stefan Hardegger
2025-07-29 11:02:46 +02:00
parent c08082c0d6
commit 5746001c4a
7 changed files with 103 additions and 6 deletions

View File

@@ -314,6 +314,7 @@ export const searchApi = {
maxRating?: number;
sortBy?: string;
sortDir?: string;
facetBy?: string[];
}): Promise<SearchResult> => {
// Create URLSearchParams to properly handle array parameters
const searchParams = new URLSearchParams();
@@ -334,6 +335,9 @@ export const searchApi = {
if (params.tags && params.tags.length > 0) {
params.tags.forEach(tag => searchParams.append('tags', tag));
}
if (params.facetBy && params.facetBy.length > 0) {
params.facetBy.forEach(facet => searchParams.append('facetBy', facet));
}
const response = await api.get(`/stories/search?${searchParams.toString()}`);
return response.data;