From c042fac365b0f76ca72f0618fec22f1b51761421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Thu, 8 Jan 2026 22:13:35 +0100 Subject: [PATCH] pl-fe: fix draft statuses regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../pl-fe/src/queries/statuses/use-draft-statuses.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/pl-fe/src/queries/statuses/use-draft-statuses.ts b/packages/pl-fe/src/queries/statuses/use-draft-statuses.ts index 9d4605a68..be54c068f 100644 --- a/packages/pl-fe/src/queries/statuses/use-draft-statuses.ts +++ b/packages/pl-fe/src/queries/statuses/use-draft-statuses.ts @@ -9,7 +9,15 @@ import { filteredArray } from 'pl-fe/schemas/utils'; import KVStore from 'pl-fe/storage/kv-store'; import { APIEntity } from 'pl-fe/types/entities'; -const draftStatusSchema = v.object({ +const draftStatusSchema = v.pipe(v.any(), v.transform((draft) => ({ + content_type: draft.contentType, + draft_id: draft.draftId, + group_id: draft.groupId, + in_reply_to: draft.inReplyTo, + media_attachments: draft.mediaAttachments, + spoiler_text: draft.spoilerText, + ...draft, +})), v.object({ content_type: v.fallback(v.string(), 'text/plain'), draft_id: v.string(), editorState: v.fallback(v.nullable(v.string()), null), @@ -23,7 +31,7 @@ const draftStatusSchema = v.object({ sensitive: v.fallback(v.boolean(), false), spoiler_text: v.fallback(v.string(), ''), text: v.fallback(v.string(), ''), -}); +})); type DraftStatus = v.InferOutput;