mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(web): search returns all value (#5210)
This commit is contained in:
parent
d49b353c49
commit
28a15365d6
2 changed files with 3 additions and 4 deletions
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
showBigSearchBar = false;
|
showBigSearchBar = false;
|
||||||
$isSearchEnabled = false;
|
$isSearchEnabled = false;
|
||||||
goto(`${AppRoute.SEARCH}?${params}`);
|
goto(`${AppRoute.SEARCH}?${params}`, { invalidateAll: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
const clearSearchTerm = (searchTerm: string) => {
|
const clearSearchTerm = (searchTerm: string) => {
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,10 @@ import { authenticate } from '$lib/utils/auth';
|
||||||
import { api } from '@api';
|
import { api } from '@api';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async (data) => {
|
||||||
const user = await authenticate();
|
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 term = url.searchParams.get('q') || url.searchParams.get('query') || undefined;
|
||||||
|
|
||||||
const { data: results } = await api.searchApi.search({}, { params: url.searchParams });
|
const { data: results } = await api.searchApi.search({}, { params: url.searchParams });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue