mirror of
https://github.com/documenso/documenso.git
synced 2026-09-29 16:24:30 +10:00
33 lines
990 B
TypeScript
33 lines
990 B
TypeScript
import { getOrganisationAnalyticsDocumentsOverTime } from '@documenso/lib/server-only/organisation/get-organisation-analytics-documents-over-time';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
import {
|
|
ZGetOrganisationAnalyticsDocumentsOverTimeRequestSchema,
|
|
ZGetOrganisationAnalyticsDocumentsOverTimeResponseSchema,
|
|
} from './get-organisation-analytics.types';
|
|
|
|
export const getOrganisationAnalyticsDocumentsOverTimeRoute = authenticatedProcedure
|
|
.input(ZGetOrganisationAnalyticsDocumentsOverTimeRequestSchema)
|
|
.output(ZGetOrganisationAnalyticsDocumentsOverTimeResponseSchema)
|
|
.query(async ({ input, ctx }) => {
|
|
const { organisationId, range, from, to, timezone } = input;
|
|
|
|
ctx.logger.info({
|
|
input: {
|
|
organisationId,
|
|
range,
|
|
from,
|
|
to,
|
|
},
|
|
});
|
|
|
|
return await getOrganisationAnalyticsDocumentsOverTime({
|
|
organisationId,
|
|
range,
|
|
from,
|
|
to,
|
|
timezone,
|
|
userId: ctx.user.id,
|
|
});
|
|
});
|