mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 12:32:34 +10:00
28 lines
646 B
TypeScript
28 lines
646 B
TypeScript
import { deleteTokenById } from '@documenso/lib/server-only/public-api/delete-api-token-by-id';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
import {
|
|
ZDeleteApiTokenRequestSchema,
|
|
ZDeleteApiTokenResponseSchema,
|
|
} from './delete-api-token.types';
|
|
|
|
export const deleteApiTokenRoute = authenticatedProcedure
|
|
.input(ZDeleteApiTokenRequestSchema)
|
|
.output(ZDeleteApiTokenResponseSchema)
|
|
.mutation(async ({ input, ctx }) => {
|
|
const { id, teamId } = input;
|
|
|
|
ctx.logger.info({
|
|
input: {
|
|
id,
|
|
teamId,
|
|
},
|
|
});
|
|
|
|
await deleteTokenById({
|
|
id,
|
|
teamId,
|
|
userId: ctx.user.id,
|
|
});
|
|
});
|