feat: Enhance event management with FightEdit and GroupEdit components, including improved data handling and new functionalities

This commit is contained in:
2025-05-22 19:41:49 +02:00
parent 1da279bb24
commit 5277c9a3fc
9 changed files with 371 additions and 112 deletions

View File

@@ -45,6 +45,15 @@ export const EventFightSchema = z.object({
export type EventFight = z.infer<typeof EventFightSchema>;
export const EventFightEditSchema = EventFightSchema.omit({
id: true,
group: true,
}).extend({
group: z.number().nullable(),
});
export type EventFightEdit = z.infer<typeof EventFightEditSchema>;
export type ResponseGroups = z.infer<typeof ResponseGroupsSchema>;
export const ResponseRelationSchema = z.object({
@@ -111,6 +120,12 @@ export const UpdateEventGroupSchema = z.object({
});
export type UpdateEventGroup = z.infer<typeof UpdateEventGroupSchema>;
export const GroupEditSchema = ResponseGroupsSchema.omit({
id: true,
points: true,
});
export type GroupUpdateEdit = z.infer<typeof GroupEditSchema>;
export const CreateEventRelationSchema = z.object({
fightId: z.number(),
team: z.enum(["RED", "BLUE"]),