diff --git a/controller/log.go b/controller/log.go index a43f7b75..ce9b4666 100644 --- a/controller/log.go +++ b/controller/log.go @@ -150,6 +150,10 @@ func GetLogsSelfStat(c *gin.Context) { return } +// DeleteHistoryLogs is the legacy synchronous log cleanup endpoint (DELETE /api/log/). +// It deletes directly instead of going through the async system task. It is kept only +// for the classic frontend; the default frontend uses POST /api/system-task/log-cleanup. +// TODO: remove this handler (and its route) once the classic frontend is removed. func DeleteHistoryLogs(c *gin.Context) { targetTimestamp, _ := strconv.ParseInt(c.Query("target_timestamp"), 10, 64) if targetTimestamp == 0 { diff --git a/router/api-router.go b/router/api-router.go index e16fd285..63401967 100644 --- a/router/api-router.go +++ b/router/api-router.go @@ -304,6 +304,8 @@ func SetApiRouter(router *gin.Engine) { } logRoute := apiRouter.Group("/log") logRoute.GET("/", middleware.AdminAuth(), controller.GetAllLogs) + // Legacy synchronous direct-delete route used only by the classic frontend. + // TODO: remove once the classic frontend is removed; the default frontend uses /system-task/log-cleanup. logRoute.DELETE("/", middleware.RootAuth(), controller.DeleteHistoryLogs) logRoute.GET("/stat", middleware.AdminAuth(), controller.GetLogsStat) logRoute.GET("/self/stat", middleware.UserAuth(), controller.GetLogsSelfStat) diff --git a/web/default/src/features/system-settings/api.ts b/web/default/src/features/system-settings/api.ts index d942634f..3ca59a77 100644 --- a/web/default/src/features/system-settings/api.ts +++ b/web/default/src/features/system-settings/api.ts @@ -19,7 +19,6 @@ For commercial licensing, please contact support@quantumnous.com import { api } from '@/lib/api' import type { ConfirmPaymentComplianceResponse, - DeleteLogsResponse, FetchUpstreamRatiosRequest, LogCleanupTask, SystemOptionsResponse, @@ -48,13 +47,6 @@ export async function confirmPaymentCompliance() { return res.data } -export async function deleteLogsBefore(targetTimestamp: number) { - const res = await api.delete('/api/log/', { - params: { target_timestamp: targetTimestamp }, - }) - return res.data -} - export async function startLogCleanupTask(targetTimestamp: number) { const res = await api.post>( '/api/system-task/log-cleanup', diff --git a/web/default/src/features/system-settings/types.ts b/web/default/src/features/system-settings/types.ts index 28acd48e..abcb97d0 100644 --- a/web/default/src/features/system-settings/types.ts +++ b/web/default/src/features/system-settings/types.ts @@ -50,12 +50,6 @@ export type ConfirmPaymentComplianceResponse = { } } -export type DeleteLogsResponse = { - success: boolean - message: string - data?: number -} - export type SystemTaskStatus = 'pending' | 'running' | 'succeeded' | 'failed' export type SystemTask<