Files
PnvPanel/frontend/src/features/admin/maintenance/api.ts
T
Leonid Pershin 94ba514b8e
CI / Backend (build + test) (push) Successful in 1m17s
CI / Frontend (lint + typecheck + build) (push) Successful in 33s
Enhance admin maintenance functionality with new endpoints and response types
- Added new DELETE endpoints for managing audit logs and disabled apps in the admin maintenance section.
- Updated existing endpoint for closed tickets to use a unified response type, `MaintenanceCleanupResponseDto`.
- Enhanced API documentation to reflect the new operations and their expected request/response formats.
- Improved frontend integration with new functions for deleting old audit logs and disabled apps, including user confirmation prompts.
- Added localization support for new maintenance actions in both Russian and English.
2026-07-14 18:37:22 +03:00

17 lines
632 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' })
}