Browse Source

markdown parameter to optional

Shun Miyazawa 11 tháng trước cách đây
mục cha
commit
6c618a9232
1 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 3 4
      apps/app/src/features/openai/server/routes/edit/index.ts

+ 3 - 4
apps/app/src/features/openai/server/routes/edit/index.ts

@@ -42,7 +42,7 @@ const LlmEditorAssistantResponseSchema = z.object({
 
 type ReqBody = {
   userMessage: string,
-  markdown: string,
+  markdown?: string,
   threadId?: string,
 }
 
@@ -71,10 +71,9 @@ export const postMessageToEditHandlersFactory: PostMessageHandlersFactory = (cro
       .notEmpty()
       .withMessage('userMessage must be set'),
     body('markdown')
+      .optional()
       .isString()
-      .withMessage('markdown must be string')
-      .notEmpty()
-      .withMessage('markdown must be set'),
+      .withMessage('markdown must be string'),
     body('threadId').optional().isString().withMessage('threadId must be string'),
   ];