- Introduced a new DELETE endpoint `/api/admin/maintenance/factory-reset` for a complete reset of the admin panel, removing all users except the current admin and clearing various data. - Implemented the `FactoryReset` method in `AdminMaintenanceEndpoints` to handle the reset logic. - Added a new method `ListAllUserIdsExceptAsync` in `IIdentityService` to retrieve user IDs excluding a specified user, aiding in the factory reset process. - Updated the frontend to include a confirmation dialog for the factory reset action, enhancing user experience and safety. - Enhanced localization support for the new factory reset feature in both Russian and English, ensuring clarity for all users.
21 lines
752 B
TypeScript
21 lines
752 B
TypeScript
import { apiRequest } from '@/shared/api/client'
|
|
import type { MaintenanceCleanupResponseDto } from '@/shared/api/types'
|
|
|
|
export function deleteClosedTickets() {
|
|
return apiRequest<MaintenanceCleanupResponseDto>('/admin/maintenance/tickets/closed', { method: 'DELETE' })
|
|
}
|
|
|
|
export function deleteOldAuditLogs(olderThanDays: number) {
|
|
return apiRequest<MaintenanceCleanupResponseDto>(`/admin/maintenance/audit-logs?olderThanDays=${olderThanDays}`, {
|
|
method: 'DELETE',
|
|
})
|
|
}
|
|
|
|
export function deleteDisabledApps() {
|
|
return apiRequest<MaintenanceCleanupResponseDto>('/admin/maintenance/apps/disabled', { method: 'DELETE' })
|
|
}
|
|
|
|
export function factoryReset() {
|
|
return apiRequest<void>('/admin/maintenance/factory-reset', { method: 'DELETE' })
|
|
}
|