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