mirror of
https://github.com/documenso/documenso.git
synced 2025-11-24 13:41:30 +10:00
chore: extract shared audit log query logic
This commit is contained in:
@ -10,34 +10,18 @@ export const findDocumentAuditLogsRoute = authenticatedProcedure
|
||||
.input(ZFindDocumentAuditLogsRequestSchema)
|
||||
.output(ZFindDocumentAuditLogsResponseSchema)
|
||||
.query(async ({ input, ctx }) => {
|
||||
const { teamId } = ctx;
|
||||
|
||||
const {
|
||||
page,
|
||||
perPage,
|
||||
documentId,
|
||||
cursor,
|
||||
filterForRecentActivity,
|
||||
eventTypes,
|
||||
orderByColumn,
|
||||
orderByDirection,
|
||||
} = input;
|
||||
const { orderByColumn, orderByDirection, ...auditLogParams } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
documentId,
|
||||
documentId: input.documentId,
|
||||
},
|
||||
});
|
||||
|
||||
return await findDocumentAuditLogs({
|
||||
...auditLogParams,
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
page,
|
||||
perPage,
|
||||
documentId,
|
||||
cursor,
|
||||
filterForRecentActivity,
|
||||
eventTypes,
|
||||
teamId: ctx.teamId,
|
||||
orderBy: orderByColumn ? { column: orderByColumn, direction: orderByDirection } : undefined,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user