adds trail author filter

This commit is contained in:
Christian Beutel
2024-11-15 23:57:09 +01:00
parent 24ef5998c0
commit f260b63d43
27 changed files with 345 additions and 153 deletions

View File

@@ -20,9 +20,9 @@ export async function users_create(user: User) {
return createdUser;
}
export async function users_search(q: string) {
export async function users_search(q: string, includeSelf: boolean = true) {
let r = await fetch('/api/v1/user/anonymous?' + new URLSearchParams({
"filter": `username~"${q}"&&id!="${pb.authStore.model?.id}"`,
"filter": `username~"${q}"${includeSelf ? '' : '&&id!="${pb.authStore.model?.id}"'}`,
}), {
method: 'GET',
})