KI-AGENT: Ergänze Mandantenexport und Import
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user