mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
28 lines
744 B
TypeScript
28 lines
744 B
TypeScript
import { createTeam } from '@documenso/lib/server-only/team/create-team';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
import { ZCreateTeamRequestSchema, ZCreateTeamResponseSchema } from './create-team.types';
|
|
|
|
export const createTeamRoute = authenticatedProcedure
|
|
// .meta(createOrganisationGroupMeta)
|
|
.input(ZCreateTeamRequestSchema)
|
|
.output(ZCreateTeamResponseSchema)
|
|
.mutation(async ({ input, ctx }) => {
|
|
const { teamName, teamUrl, organisationId, inheritMembers } = input;
|
|
const { user } = ctx;
|
|
|
|
ctx.logger.info({
|
|
input: {
|
|
organisationId,
|
|
},
|
|
});
|
|
|
|
return await createTeam({
|
|
userId: user.id,
|
|
teamName,
|
|
teamUrl,
|
|
organisationId,
|
|
inheritMembers,
|
|
});
|
|
});
|