mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-03 18:50:30 +08:00
@@ -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<string, number>[];
|
||||
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<Comment>;
|
||||
|
||||
Reference in New Issue
Block a user