0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-07 00:50:23 -05:00

fix(web): search params (#7123)

* fix(web): search params

* format
This commit is contained in:
Alex 2024-02-14 20:43:48 -06:00 committed by GitHub
parent 31ae35e9a6
commit 9b814354a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);