Skip to content

Commit

Permalink
fix(web): search params (#7123)
Browse files Browse the repository at this point in the history
* fix(web): search params

* format
  • Loading branch information
alextran1502 committed Feb 15, 2024
1 parent 31ae35e commit 9b81435
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/src/routes/(user)/search/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export const load = (async (data) => {
url.searchParams.get(QueryParameter.SEARCH_TERM) || url.searchParams.get(QueryParameter.QUERY) || undefined;
let results: SearchResponseDto | null = null;
if (term) {
const response = await search({ ...data.url.searchParams });
let params = {};
for (const [key, value] of data.url.searchParams) {
params = { ...params, [key]: value };
}
const response = await search({ ...params });
let items: AssetResponseDto[] = (data as unknown as { results: SearchResponseDto }).results?.assets.items;
if (items) {
items.push(...response.assets.items);
Expand Down

0 comments on commit 9b81435

Please sign in to comment.