We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba92c07 commit c045ea9Copy full SHA for c045ea9
src/components/editor2/validation/schema.ts
@@ -28,9 +28,16 @@ const doc = z.looseObject({
28
details_color: z.string().optional(),
29
})
30
31
-const docStrict = doc.extend({
32
- title: doc.shape.title.unwrap().min(1),
33
-})
+const docStrict = doc
+ .extend({
+ title: doc.shape.title.unwrap().min(1),
34
+ })
35
+ .transform((doc) => ({
36
+ ...doc,
37
+ // the backend requires details to be non-empty, but we don't want to
38
+ // force the user to fill it in, so we use title as a fallback
39
+ details: doc.details || doc.title,
40
+ }))
41
42
const operator_requirements = z.looseObject({
43
elite: z.number().int().min(0).max(2).optional(),
0 commit comments