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 (editorVersion) document.editorVersion = editorVersion;
|
||||||
if (templateId) document.templateId = templateId;
|
if (templateId) document.templateId = templateId;
|
||||||
|
|
||||||
if (append) {
|
if (!user.team?.collaborativeEditing) {
|
||||||
document.text += text;
|
if (append) {
|
||||||
} else if (text !== undefined) {
|
document.text += text;
|
||||||
document.text = text;
|
} else if (text !== undefined) {
|
||||||
|
document.text = text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.lastModifiedById = user.id;
|
document.lastModifiedById = user.id;
|
||||||
const { collection } = document;
|
const { collection } = document;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user