Add guard against overwriting text when collaborative editing enabled
This commit is contained in:
@ -1038,11 +1038,14 @@ router.post("documents.update", auth(), async (ctx) => {
|
||||
if (editorVersion) document.editorVersion = editorVersion;
|
||||
if (templateId) document.templateId = templateId;
|
||||
|
||||
if (append) {
|
||||
document.text += text;
|
||||
} else if (text !== undefined) {
|
||||
document.text = text;
|
||||
if (!user.team?.collaborativeEditing) {
|
||||
if (append) {
|
||||
document.text += text;
|
||||
} else if (text !== undefined) {
|
||||
document.text = text;
|
||||
}
|
||||
}
|
||||
|
||||
document.lastModifiedById = user.id;
|
||||
const { collection } = document;
|
||||
|
||||
|
Reference in New Issue
Block a user