mirror of
https://github.com/documenso/documenso.git
synced 2026-09-29 16:24:30 +10:00
34 lines
845 B
TypeScript
34 lines
845 B
TypeScript
import { getTeamAnalyticsOverview } from '@documenso/lib/server-only/team/get-team-analytics-overview';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
import {
|
|
ZGetTeamAnalyticsOverviewRequestSchema,
|
|
ZGetTeamAnalyticsOverviewResponseSchema,
|
|
} from './get-team-analytics.types';
|
|
|
|
export const getTeamAnalyticsOverviewRoute = authenticatedProcedure
|
|
.input(ZGetTeamAnalyticsOverviewRequestSchema)
|
|
.output(ZGetTeamAnalyticsOverviewResponseSchema)
|
|
.query(async ({ input, ctx }) => {
|
|
const { teamId, range, from, to, timezone } = input;
|
|
|
|
ctx.logger.info({
|
|
input: {
|
|
teamId,
|
|
range,
|
|
from,
|
|
to,
|
|
},
|
|
});
|
|
|
|
return await getTeamAnalyticsOverview({
|
|
teamId,
|
|
range,
|
|
from,
|
|
to,
|
|
timezone,
|
|
userId: ctx.user.id,
|
|
userEmail: ctx.user.email,
|
|
});
|
|
});
|