AI Implementation feature(902): Admin Area Challenges: List, Import/Export and Add/Edit Modal 1.02 (#43)
This commit was merged in pull request #43.
This commit is contained in:
@@ -15,12 +15,12 @@ export const ChallengeDifficultySchema = z.enum(DIFFICULTIES);
|
||||
export const ChallengeProtocolSchema = z.enum(PROTOCOLS);
|
||||
|
||||
export const ChallengeIdParamSchema = z.object({
|
||||
id: z.string().min(1).max(64),
|
||||
id: z.string().uuid({ message: 'Invalid challenge id' }),
|
||||
});
|
||||
|
||||
export const ListChallengesQuerySchema = z.object({
|
||||
q: z.string().trim().min(1).max(128).optional(),
|
||||
categoryId: z.string().min(1).max(64).optional(),
|
||||
categoryId: z.string().uuid({ message: 'Invalid category id' }).optional(),
|
||||
});
|
||||
export type ListChallengesQuery = z.infer<typeof ListChallengesQuerySchema>;
|
||||
|
||||
@@ -44,7 +44,7 @@ const portField = z
|
||||
|
||||
const baseShape = {
|
||||
descriptionMd: z.string().max(64_000),
|
||||
categoryId: z.string().min(1).max(64),
|
||||
categoryId: z.string().uuid({ message: 'Category is required' }),
|
||||
difficulty: ChallengeDifficultySchema,
|
||||
initialPoints: z.number().int().min(1).max(100000),
|
||||
minimumPoints: z.number().int().min(1).max(100000),
|
||||
|
||||
Reference in New Issue
Block a user