From 149a5d6fb547cc344de9c8754d287d78b2e96888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Tue, 27 Jun 2023 18:21:21 +0200 Subject: [PATCH] Fix comment schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rūdolfs Ošiņš --- httpd-client/lib/project/comment.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/httpd-client/lib/project/comment.ts b/httpd-client/lib/project/comment.ts index a8a992516..cea926e28 100644 --- a/httpd-client/lib/project/comment.ts +++ b/httpd-client/lib/project/comment.ts @@ -1,5 +1,5 @@ import type { ZodSchema } from "zod"; -import { array, number, record, object, string } from "zod"; +import { array, number, object, string, tuple } from "zod"; export type ThreadUpdateAction = | { type: "comment"; body: string; replyTo?: string } @@ -16,7 +16,7 @@ export interface Comment { id: string; author: { id: string; alias?: string }; body: string; - reactions: Record[]; + reactions: [string, string][]; timestamp: number; replyTo: string | null; } @@ -25,7 +25,7 @@ export const commentSchema = object({ id: string(), author: object({ id: string(), alias: string().optional() }), body: string(), - reactions: array(record(string(), number())), + reactions: array(tuple([string(), string()])), timestamp: number(), replyTo: string().nullable(), }) satisfies ZodSchema;