mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
web: Use Zod z.discriminatedUnion more.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
a03a26151c
commit
aaa6f16538
@@ -36,7 +36,7 @@ const draft_schema = z.intersection(
|
||||
content: z.string(),
|
||||
updatedAt: z.number(),
|
||||
}),
|
||||
z.union([
|
||||
z.discriminatedUnion("type", [
|
||||
z.object({
|
||||
type: z.literal("stream"),
|
||||
topic: z.string(),
|
||||
@@ -61,7 +61,7 @@ const possibly_buggy_draft_schema = z.intersection(
|
||||
content: z.string(),
|
||||
updatedAt: z.number(),
|
||||
}),
|
||||
z.union([
|
||||
z.discriminatedUnion("type", [
|
||||
z.object({
|
||||
type: z.literal("stream"),
|
||||
topic: z.string().optional(),
|
||||
|
||||
Reference in New Issue
Block a user