adds list editor

This commit is contained in:
Christian Beutel
2024-09-08 15:11:19 +02:00
parent 84873ce5b9
commit da658fdf27
23 changed files with 751 additions and 105 deletions

View File

@@ -32,6 +32,23 @@ export async function lists_index(filter?: ListFilter, f: (url: RequestInfo | UR
}
export async function lists_show(id: string, f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch) {
const r = await f(`/api/v1/list/${id}`, {
method: 'GET',
})
const response = await r.json()
if (!r.ok) {
throw new ClientResponseError(response)
}
list.set(response);
return response;
}
export async function lists_create(list: List, avatar?: File) {
if (!pb.authStore.model) {
throw new Error("Unauthenticated");