<script setup lang="ts">
import { listUsers } from '~/lib/api/admin/listUsers';

const adminStore = useAdminStore();

await useAsyncData('users', async () => {
    const response = await listUsers();

    if (response.success) {
        adminStore.users = response.users;
    }
});
</script>

<template>
    <NuxtLayout name="default">
        <AdminCreateUserDialog />
        <AdminDeleteUserDialog />
        <slot />
    </NuxtLayout>
</template>
