use callbak

This commit is contained in:
Harsh Mahajan committed 2025-11-05 16:06:03 +05:30
1 parent d17092eb0f
commit cfde744f39
2 files changed
+5 -6

No files matched your search

@@ -140,7 +140,7 @@
{#each [...$groups] as [role, permission] (role)}
<Table.Row.Base {root}>
<Table.Cell column="role" {root}>
<Row {role} on:notFound={() => deleteRole(role)} />
<Row {role} onNotFound={() => deleteRole(role)} />
</Table.Cell>
<Table.Cell column="create" {root}>
<Selector.Checkbox
+4 -5
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { type ComponentProps, type Snippet, createEventDispatcher, onMount } from 'svelte';
import { type ComponentProps, type Snippet, onMount } from 'svelte';
import { sdk } from '$lib/stores/sdk';
import type { Models } from '@appwrite.io/console';
import { AvatarInitials } from '../';
@@ -34,11 +34,10 @@
role: string;
placement?: ComponentProps<Popover>['placement'];
children?: Snippet;
onNotFound?: (role: string) => void;
}
let { role, placement = 'bottom-start', children }: Props = $props();
const dispatch = createEventDispatcher<{ notFound: string }>();
let { role, placement = 'bottom-start', children, onNotFound }: Props = $props();
type ParsedPermission = {
type: 'user' | 'team' | 'other';
@@ -117,7 +116,7 @@
try {
const data = await getData(role);
if (data?.notFound) {
dispatch('notFound', role);
onNotFound?.(role);
}
} catch {}
}