feat(admin): archive users and their profiles permanently
This commit is contained in:
@@ -12,6 +12,7 @@ const createUserModalOpen = ref(false)
|
||||
const createdUserPassword = ref("")
|
||||
const users = ref<AdminUser[]>([])
|
||||
const searchString = ref("")
|
||||
const showArchived = ref(false)
|
||||
|
||||
const createUserForm = ref({
|
||||
email: "",
|
||||
@@ -27,13 +28,15 @@ const templateColumns = [
|
||||
{ key: "email", label: "E-Mail" },
|
||||
{ key: "tenant_count", label: "Tenants" },
|
||||
{ key: "is_admin", label: "Admin" },
|
||||
{ key: "status", label: "Status" },
|
||||
]
|
||||
|
||||
const filteredRows = computed(() => {
|
||||
const search = searchString.value.trim().toLowerCase()
|
||||
const rows = users.value.map((user) => ({
|
||||
const rows = users.value.filter((user) => showArchived.value || !user.archived_at).map((user) => ({
|
||||
...user,
|
||||
tenant_count: user.tenant_ids.length,
|
||||
status: user.archived_at ? "Archiviert" : "Aktiv",
|
||||
is_admin: user.is_admin ? "Ja" : "Nein",
|
||||
}))
|
||||
|
||||
@@ -50,7 +53,7 @@ const fetchUsers = async () => {
|
||||
loading.value = true
|
||||
|
||||
try {
|
||||
const overview = await admin.getOverview()
|
||||
const overview = await admin.getOverview(true)
|
||||
users.value = overview.users
|
||||
} catch (err: any) {
|
||||
console.error("[administration/users/index]", err)
|
||||
@@ -119,6 +122,7 @@ onMounted(async () => {
|
||||
<template>
|
||||
<UDashboardNavbar title="Administration: Benutzer" :badge="filteredRows.length">
|
||||
<template #right>
|
||||
<UCheckbox v-model="showArchived" label="Archivierte anzeigen" />
|
||||
<UInput
|
||||
v-model="searchString"
|
||||
icon="i-heroicons-magnifying-glass"
|
||||
|
||||
Reference in New Issue
Block a user