strart trail sharing implementation

This commit is contained in:
Christian Beutel
2024-05-09 19:48:31 +02:00
parent 9d43df3d16
commit 5d46ad96b4
17 changed files with 408 additions and 10 deletions

View File

@@ -23,6 +23,21 @@ export async function users_create(user: User) {
await settings_create(settings);
}
export async function users_search(q: string) {
let r = await fetch('/api/v1/user?' + new URLSearchParams({
"filter": `username~"${q}"`,
}), {
method: 'GET',
})
const response = await r.json()
if (r.ok) {
return response.items;
} else {
throw new ClientResponseError(response)
}
}
export async function users_auth_methods(f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch): Promise<AuthMethodsList> {
const r = await f('/api/v1/auth/oauth', {
method: 'GET',