Files
sign/packages/trpc/server/team-router/find-teams-route.ts
2024-12-30 21:01:03 +11:00

28 lines
749 B
TypeScript

import { z } from 'zod';
import { findTeams } from '@documenso/lib/server-only/team/find-teams';
import { ZFindSearchParamsSchema } from '@documenso/lib/types/search-params';
import { authenticatedProcedure } from '../trpc';
export const ZFindTeamsRequestSchema = ZFindSearchParamsSchema;
export const findTeamsRoute = authenticatedProcedure
// .meta({
// openapi: {
// method: 'GET',
// path: '/team',
// summary: 'Find teams',
// description: 'Find your teams based on a search criteria',
// tags: ['Teams'],
// },
// })
.input(ZFindTeamsRequestSchema)
.output(z.unknown())
.query(async ({ input, ctx }) => {
return await findTeams({
userId: ctx.user.id,
...input,
});
});