mirror of
https://github.com/documenso/documenso.git
synced 2025-11-18 02:32:00 +10:00
31 lines
882 B
TypeScript
31 lines
882 B
TypeScript
import { z } from 'zod';
|
|
|
|
import { requestTeamOwnershipTransfer } from '@documenso/lib/server-only/team/request-team-ownership-transfer';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
|
|
export const ZRequestTeamOwnershipTransferRequestSchema = z.object({
|
|
teamId: z.number(),
|
|
newOwnerUserId: z.number(),
|
|
clearPaymentMethods: z.boolean(),
|
|
});
|
|
|
|
export const requestTeamOwnershipTransferRoute = authenticatedProcedure
|
|
// .meta({
|
|
// openapi: {
|
|
// method: 'POST',
|
|
// path: '/team/{teamId}/transfer',
|
|
// summary: 'Request a team ownership transfer',
|
|
// description: '',
|
|
// tags: ['Teams'],
|
|
// },
|
|
// })
|
|
.input(ZRequestTeamOwnershipTransferRequestSchema)
|
|
.mutation(async ({ input, ctx }) => {
|
|
return await requestTeamOwnershipTransfer({
|
|
userId: ctx.user.id,
|
|
userName: ctx.user.name ?? '',
|
|
...input,
|
|
});
|
|
});
|