feat(admin): archive users and their profiles permanently
All checks were successful
Build and Release FEDEO / verify (push) Successful in 1m5s
Build and Release FEDEO / build-and-release (push) Successful in 6m53s

This commit is contained in:
2026-10-15 14:22:12 +02:00
parent 5dc9e686fc
commit 4ffafef3f1
26 changed files with 519 additions and 75 deletions

View File

@@ -23,11 +23,13 @@ export type AdminUserProfile = {
last_name: string
email?: string | null
active: boolean
archived_at: string | null
}
export type AdminUser = {
id: string
email: string
archived_at: string | null
display_name: string
multiTenant: boolean
must_change_password: boolean
@@ -161,8 +163,8 @@ export type CreateInstanceAgentResult = {
export const useAdmin = () => {
const { $api } = useNuxtApp()
const getOverview = async (): Promise<AdminOverview> => {
const response = await $api("/api/admin/overview") as any
const getOverview = async (includeArchived = false): Promise<AdminOverview> => {
const response = await $api("/api/admin/overview", { query: { includeArchived } }) as any
return {
users: response?.users || [],
@@ -193,6 +195,10 @@ export const useAdmin = () => {
})
}
const archiveUser = async (id: string) => {
return await $api(`/api/admin/users/${id}/archive`, { method: "POST" })
}
const resetUserPassword = async (id: string, password?: string) => {
return await $api(`/api/admin/users/${id}/reset-password`, {
method: "POST",
@@ -294,6 +300,7 @@ export const useAdmin = () => {
createUserForProfile,
updateUser,
resetUserPassword,
archiveUser,
updateUserAccess,
createTenant,
invitePortalUser,