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

const adminStore = useAdminStore();

await useAsyncData('admin-resources', async () => {
    const response = await fetchAllAdminResources();

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

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

        <AdminCreateWarrenDialog />
        <AdminEditWarrenDialog />
        <AdminDeleteWarrenDialog />

        <slot />
    </NuxtLayout>
</template>
