Improve document revision creation (#5474)
This commit is contained in:
@@ -899,6 +899,7 @@ router.post(
|
||||
collectionId,
|
||||
append,
|
||||
apiVersion,
|
||||
done,
|
||||
} = ctx.input.body;
|
||||
const editorVersion = ctx.headers["x-editor-version"] as string | undefined;
|
||||
const { user } = ctx.state.auth;
|
||||
@@ -937,6 +938,7 @@ router.post(
|
||||
templateId,
|
||||
editorVersion,
|
||||
transaction,
|
||||
done,
|
||||
ip: ctx.request.ip,
|
||||
});
|
||||
|
||||
|
||||
@@ -203,6 +203,9 @@ export const DocumentsUpdateSchema = BaseSchema.extend({
|
||||
|
||||
/** Version of the API to be used */
|
||||
apiVersion: z.number().optional(),
|
||||
|
||||
/** Whether the editing session is complete */
|
||||
done: z.boolean().optional(),
|
||||
}),
|
||||
}).refine((req) => !(req.body.append && !req.body.text), {
|
||||
message: "text is required while appending",
|
||||
|
||||
Reference in New Issue
Block a user