diff --git a/islands/Admin.tsx b/islands/Admin.tsx index 078cb2d..f4f5aa5 100644 --- a/islands/Admin.tsx +++ b/islands/Admin.tsx @@ -9,6 +9,13 @@ export interface Props { todos: Todo[] } +async function promptDeleteUser(id: string, name: string) { + if (confirm(`Are you sure you want to delete ${name} (${id})?`)) { + await fetch(`/api/user?id=${id}`, { method: 'DELETE' }) + location.reload() + } +} + export function Admin({ users, todos }: Props) { const addUserDialog = createRef() const usersById: Record = {} @@ -35,6 +42,7 @@ export function Admin({ users, todos }: Props) { action='/api/user' method='post' encType='multipart/form-data' + onSubmit={() => console.log('Submitting...')} >