KI-AGENT: Ergänze Mandantenexport und Import
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 18s
Build and Push Docker Images / build-frontend (push) Successful in 51s
Build and Push Docker Images / build-docs (push) Successful in 11s

This commit is contained in:
2026-05-18 21:23:18 +02:00
parent 9c6a6a841a
commit bb3b842be1
5 changed files with 571 additions and 0 deletions

View File

@@ -48,6 +48,13 @@ export type AdminOverview = {
unassignedProfiles: AdminUserProfile[]
}
export type TenantImportResult = {
success: boolean
tenantId: number
tables: { table: string; rows: number }[]
files: { restored: number; skipped: number }
}
export const useAdmin = () => {
const { $api } = useNuxtApp()
@@ -110,6 +117,19 @@ export const useAdmin = () => {
})
}
const exportTenant = async (id: number): Promise<Blob> => {
return await $api(`/api/admin/tenants/${id}/export`, {
responseType: "blob",
})
}
const importTenant = async (body: Record<string, any>): Promise<TenantImportResult> => {
return await $api("/api/admin/tenant-imports", {
method: "POST",
body,
})
}
return {
getOverview,
createUser,
@@ -119,5 +139,7 @@ export const useAdmin = () => {
createTenant,
invitePortalUser,
updateTenant,
exportTenant,
importTenant,
}
}