fix(datatables): tell the caller when roles have been saved

This commit is contained in:
Diego Imbert
2026-08-31 06:01:13 +02:00
parent 19035031b7
commit 6e76edb279
2 changed files with 6 additions and 2 deletions
@@ -58,7 +58,6 @@
bind:value={privileges}
items={available.map((p) => ({ value: p, label: p }))}
placeholder="privileges"
size="xs"
{disabled}
class="min-w-56"
/>
@@ -34,7 +34,8 @@
workspace,
datatable,
disabled = false,
hideTrigger = false
hideTrigger = false,
onSaved
}: {
workspace: string
datatable: string
@@ -42,6 +43,9 @@
/** Mount the drawer without its button, so a caller can drive it via `open()`
* (the database manager opens it from the tree's row menu). */
hideTrigger?: boolean
/** Called once the roles have actually changed, so a caller showing them
* (the manager's role picker) can read them again. */
onSaved?: () => void
} = $props()
// Matches every workspace member, unlike the `all` group whose membership is
@@ -214,6 +218,7 @@
sendUserToast('Data table permissions saved')
preview = undefined
await load()
onSaved?.()
} catch (e) {
sendUserToast(e?.body ?? e?.message ?? String(e), true)
} finally {