18 lines
588 B
TypeScript
18 lines
588 B
TypeScript
import { z } from "zod";
|
|
|
|
export const CreateRoleSchema = z.object({
|
|
name: z.string().min(1, "Název role je povinný"),
|
|
display_name: z.string().min(1, "Zobrazovaný název je povinný"),
|
|
description: z.string().nullish(),
|
|
permission_ids: z.array(z.number()).optional(),
|
|
});
|
|
|
|
export const UpdateRoleSchema = z.object({
|
|
display_name: z.string().optional(),
|
|
description: z.string().optional(),
|
|
permission_ids: z.array(z.number()).optional(),
|
|
});
|
|
|
|
export type CreateRoleInput = z.infer<typeof CreateRoleSchema>;
|
|
export type UpdateRoleInput = z.infer<typeof UpdateRoleSchema>;
|