(info: {
workspaceId: string;
relatedId?: string;
relatedType?: WorkspaceAuditLogType;
content: string;
})
| 5 | * create audit log which can query by log |
| 6 | */ |
| 7 | export async function createAuditLog(info: { |
| 8 | workspaceId: string; |
| 9 | relatedId?: string; |
| 10 | relatedType?: WorkspaceAuditLogType; |
| 11 | content: string; |
| 12 | }) { |
| 13 | try { |
| 14 | const log = await prisma.workspaceAuditLog.create({ |
| 15 | data: { |
| 16 | ...info, |
| 17 | }, |
| 18 | }); |
| 19 | |
| 20 | return log; |
| 21 | } catch (err) { |
| 22 | console.error('[AuditLog] create log error', String(err)); |
| 23 | } |
| 24 | } |
no test coverage detected