chatbridge/server/schemas/group.schema.ts

21 lines
585 B
TypeScript
Raw Normal View History

2023-07-25 01:40:22 +00:00
import { object, string, TypeOf } from 'zod';
export const createGroupSchema = object({
body: object({
name: string({
required_error: "Name for group required"
}),
token: string({
required_error: "Administration token required for creating groups"
})
})
})
export const getGroupSchema = object({
name: string({
required_error: "Name of group required to get group"
})
})
export type CreateGroupInput = TypeOf<typeof createGroupSchema>['body'];
export type GetGroupInput = TypeOf<typeof getGroupSchema>;