mirror of
https://github.com/documenso/documenso.git
synced 2025-11-20 03:32:14 +10:00
23 lines
646 B
TypeScript
23 lines
646 B
TypeScript
import { createOrganisation } from '@documenso/lib/server-only/organisation/create-organisation';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
import {
|
|
ZCreateOrganisationRequestSchema,
|
|
ZCreateOrganisationResponseSchema,
|
|
} from './create-organisation.types';
|
|
|
|
export const createOrganisationRoute = authenticatedProcedure
|
|
// .meta(createOrganisationMeta)
|
|
.input(ZCreateOrganisationRequestSchema)
|
|
.output(ZCreateOrganisationResponseSchema)
|
|
.mutation(async ({ input, ctx }) => {
|
|
const { name, url } = input;
|
|
const { user } = ctx;
|
|
|
|
await createOrganisation({
|
|
userId: user.id,
|
|
name,
|
|
url,
|
|
});
|
|
});
|