feat(audit): change audit log action to string at db level and split file/folder actions

This commit is contained in:
yiling
2026-08-01 14:49:08 +08:00
parent 6d80f06c22
commit 5ef7716c9c
19 changed files with 192 additions and 193 deletions
+3 -3
View File
@@ -37,7 +37,7 @@ const route = new Hono<{ Variables: { user: User } }>()
const parentCtx = await assetService.getAssetContext(req.parentId)
await auditLogService.logAction({
action: AuditAction.asset_create,
action: AuditAction.folder_create,
teamId: parentCtx.teamId,
userId: user.id,
projectId: parentCtx.projectId,
@@ -84,7 +84,7 @@ const route = new Hono<{ Variables: { user: User } }>()
const ctx = await assetService.getAssetContext(folderId)
await auditLogService.logAction({
action: AuditAction.asset_update,
action: AuditAction.folder_update,
teamId: ctx.teamId,
userId: user.id,
projectId: ctx.projectId,
@@ -149,7 +149,7 @@ const route = new Hono<{ Variables: { user: User } }>()
for (let i = 0; i < req.ids.length; i++) {
const ctx = contexts[i]
await auditLogService.logAction({
action: AuditAction.asset_delete,
action: AuditAction.folder_delete,
teamId: ctx.teamId,
userId: user.id,
projectId: ctx.projectId,