mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
use callbak
This commit is contained in:
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
|
||||
|
||||
@@ -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 {}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user