add / edit / delete user warrens

This commit is contained in:
2025-07-21 19:27:41 +02:00
parent 50e066f794
commit 2c26002507
86 changed files with 2197 additions and 300 deletions

View File

@@ -1,5 +1,5 @@
import type { AuthUser } from '#shared/types/auth';
import type { AdminResources } from '~/shared/types/admin';
import type { AdminResources, AuthUserWithWarrens } from '~/shared/types/admin';
export const useAdminStore = defineStore('admin', {
state: () => ({
@@ -8,7 +8,7 @@ export const useAdminStore = defineStore('admin', {
warrens: {},
} as AdminResources,
createUserDialogOpen: false,
editUserDialog: null as { user: AuthUser } | null,
editUserDialog: null as { user: AuthUserWithWarrens } | null,
deleteUserDialog: null as { user: AuthUser } | null,
}),
actions: {
@@ -18,7 +18,7 @@ export const useAdminStore = defineStore('admin', {
closeCreateUserDialog() {
this.createUserDialogOpen = false;
},
openEditUserDialog(user: AuthUser) {
setEditUserDialog(user: AuthUserWithWarrens) {
this.editUserDialog = { user };
},
closeEditUserDialog() {

View File

@@ -1,10 +1,10 @@
import { defineStore } from 'pinia';
import type { DirectoryEntry } from '#shared/types';
import type { Warren } from '#shared/types/warrens';
import type { WarrenData } from '#shared/types/warrens';
export const useWarrenStore = defineStore('warrens', {
state: () => ({
warrens: {} as Record<string, Warren>,
warrens: {} as Record<string, WarrenData>,
current: null as { warrenId: string; path: string } | null,
loading: false,
}),