diff options
| author | Adam Soltys <[email protected]> | 2025-07-18 13:03:59 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-07-18 13:03:59 -0700 |
| commit | f063e6a88999f1fe4d9ed2900b90efba1bcf1ac5 (patch) | |
| tree | 946f9accb649e8fc56d7ebd055581502dc1b63a7 | |
| parent | 2ebe1be60829be66936adf8cca35c239e6d16e7a (diff) | |
| download | coinos-ui-f063e6a88999f1fe4d9ed2900b90efba1bcf1ac5.tar.gz coinos-ui-f063e6a88999f1fe4d9ed2900b90efba1bcf1ac5.zip | |
manager delete
| -rw-r--r-- | src/routes/(app)/fund/[id]/access/+page.server.ts | 3 | ||||
| -rw-r--r-- | src/routes/(app)/fund/[id]/access/+page.svelte | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/routes/(app)/fund/[id]/access/+page.server.ts b/src/routes/(app)/fund/[id]/access/+page.server.ts index c38cb29b..36191643 100644 --- a/src/routes/(app)/fund/[id]/access/+page.server.ts +++ b/src/routes/(app)/fund/[id]/access/+page.server.ts @@ -11,11 +11,8 @@ export const actions = { const form = await fd(request); try { - console.log("SUBMITTING", form); const managers = await post("/fund/managers", form, auth(cookies)); - console.log(managers); - return { managers }; } catch (e) { const { message } = e as Error; diff --git a/src/routes/(app)/fund/[id]/access/+page.svelte b/src/routes/(app)/fund/[id]/access/+page.svelte index a2ea9dff..23a829a9 100644 --- a/src/routes/(app)/fund/[id]/access/+page.svelte +++ b/src/routes/(app)/fund/[id]/access/+page.svelte @@ -6,10 +6,14 @@ let { data } = $props(); let { id, managers } = $derived(data); + let m = $state(data.managers); let username = $state(); - let del = async ({ id }) => { + let del = async (e, user) => { + e.preventDefault(); try { - await post("/post/fund/access/delete", { id }); + m = await post(`/post/fund/${id}/managers/delete`, { + id: user.id, + }); } catch (e) { fail(e.message); } @@ -25,14 +29,14 @@ Fund managers </h1> - {#each managers as c} + {#each m as c} <a href={`/${c.username}`} class="contents"> <div class="flex hover:bg-base-200 p-2 items-center"> <Avatar user={c} size={20} disabled={true} /> <div class="my-auto text-left"> <p class="ml-1 text-lg break-words">{c.username}</p> </div> - <button onclick={() => del(c)} class="ml-auto"> + <button onclick={(e) => del(e, c)} class="ml-auto"> <iconify-icon icon="ph:trash-bold" width="32"></iconify-icon> </button> </div> |
