Skip to content

Commit

Permalink
fix(web): search returns all value (immich-app#5210)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextran1502 authored Nov 21, 2023
1 parent d49b353 commit 28a1536
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
showBigSearchBar = false;
$isSearchEnabled = false;
goto(`${AppRoute.SEARCH}?${params}`);
goto(`${AppRoute.SEARCH}?${params}`, { invalidateAll: true });
}
const clearSearchTerm = (searchTerm: string) => {
Expand Down
5 changes: 2 additions & 3 deletions web/src/routes/(user)/search/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import { authenticate } from '$lib/utils/auth';
import { api } from '@api';
import type { PageLoad } from './$types';

export const load = (async () => {
export const load = (async (data) => {
const user = await authenticate();
const url = new URL(location.href);
const url = new URL(data.url.href);
const term = url.searchParams.get('q') || url.searchParams.get('query') || undefined;

const { data: results } = await api.searchApi.search({}, { params: url.searchParams });

return {
Expand Down

0 comments on commit 28a1536

Please sign in to comment.