mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
Extracts the API implementation to a package so we can potentially reuse it across different applications in the event that we move off using a Next.js API route. Additionally tidies up the tokens page and form to be more simplified.
20 lines
618 B
TypeScript
20 lines
618 B
TypeScript
import { z } from 'zod';
|
|
|
|
export const ZGetApiTokenByIdQuerySchema = z.object({
|
|
id: z.number().min(1),
|
|
});
|
|
|
|
export type TGetApiTokenByIdQuerySchema = z.infer<typeof ZGetApiTokenByIdQuerySchema>;
|
|
|
|
export const ZCreateTokenMutationSchema = z.object({
|
|
tokenName: z.string().min(3, { message: 'The token name should be 3 characters or longer' }),
|
|
});
|
|
|
|
export type TCreateTokenMutationSchema = z.infer<typeof ZCreateTokenMutationSchema>;
|
|
|
|
export const ZDeleteTokenByIdMutationSchema = z.object({
|
|
id: z.number().min(1),
|
|
});
|
|
|
|
export type TDeleteTokenByIdMutationSchema = z.infer<typeof ZDeleteTokenByIdMutationSchema>;
|