Skip to content

Commit

Permalink
ui: search update query to API
Browse files Browse the repository at this point in the history
Signed-off-by: pamfilos <[email protected]>
  • Loading branch information
pamfilos committed Oct 31, 2024
1 parent 8792f76 commit 79cce06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ui/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type Params = {
page?: number;
page_size?: number;
search?: string;
search_simple_query_string?: string;
country?: string | string[];
journal?: string | string[];
publication_year__range?: string;
Expand Down
3 changes: 3 additions & 0 deletions ui/src/utils/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const authToken = Token
const buildSearchParams = (q: Params): string => {
const searchParams = new URLSearchParams();

// replace 'search' param with 'search_simple_query_string'
if (q["search"]) q['search_simple_query_string'] = q["search"];

Object.entries(q).forEach(([key, value]) => {
if (Array.isArray(value)) {
value.forEach(item => searchParams.append(key, item));
Expand Down

0 comments on commit 79cce06

Please sign in to comment.