Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

attachments: Extract attachment_schema.

Anders Kaseorg9ca13fb0a54d
diff --git a/web/src/attachments.ts b/web/src/attachments.ts
index 82b1edabb02..ee10401dffc 100644
--- a/web/src/attachments.ts
+++ b/web/src/attachments.ts
@@ -1,20 +1,20 @@
import {z} from "zod";
-const attachments_schema = z.array(
- z.object({
- id: z.number(),
- name: z.string(),
- path_id: z.string(),
- size: z.number(),
- create_time: z.number(),
- messages: z.array(
- z.object({
- id: z.number(),
- date_sent: z.number(),
- }),
- ),
- }),
-);
+export const attachment_schema = z.object({
+ id: z.number(),
+ name: z.string(),
+ path_id: z.string(),
+ size: z.number(),
+ create_time: z.number(),
+ messages: z.array(
+ z.object({
+ id: z.number(),
+ date_sent: z.number(),
+ }),
+ ),
+});
+
+const attachments_schema = z.array(attachment_schema);
export const attachment_api_response_schema = z.object({
attachments: attachments_schema,