fix(web): search returns all value (#5210)

This commit is contained in:
Alex 2023-11-20 20:58:22 -06:00 committed by GitHub
parent d49b353c49
commit 28a15365d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -33,7 +33,7 @@
showBigSearchBar = false;
$isSearchEnabled = false;
goto(`${AppRoute.SEARCH}?${params}`);
goto(`${AppRoute.SEARCH}?${params}`, { invalidateAll: true });
}
const clearSearchTerm = (searchTerm: string) => {

View file

@ -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 {