mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 04:31:39 +10:00
25 lines
613 B
TypeScript
25 lines
613 B
TypeScript
import { z } from 'zod';
|
|
|
|
import { getTeamById } from '@documenso/lib/server-only/team/get-team';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
|
|
export const ZGetTeamRequestSchema = z.object({
|
|
teamId: z.number(),
|
|
});
|
|
|
|
export const getTeamRoute = authenticatedProcedure
|
|
// .meta({
|
|
// openapi: {
|
|
// method: 'GET',
|
|
// path: '/team/{teamId}',
|
|
// summary: 'Get team',
|
|
// tags: ['Teams'],
|
|
// },
|
|
// })
|
|
.input(ZGetTeamRequestSchema)
|
|
.output(z.unknown())
|
|
.query(async ({ input, ctx }) => {
|
|
return await getTeamById({ teamId: input.teamId, userId: ctx.user.id });
|
|
});
|