feat(web): automatically update user info (#5647)
* use svelte store * fix: websocket error when not authenticated * more routes
This commit is contained in:
@@ -3,13 +3,12 @@ import { api } from '@api';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async (data) => {
|
||||
const user = await authenticate();
|
||||
await authenticate();
|
||||
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 {
|
||||
user,
|
||||
term,
|
||||
results,
|
||||
meta: {
|
||||
|
||||
Reference in New Issue
Block a user