🩹 back,front: when moving an item, check for a new available name (#706)

This commit is contained in:
Eric Doughty-Papassideris
2024-10-24 18:05:19 +02:00
committed by ericlinagora
parent e07ddf5197
commit d0609f7fc7
7 changed files with 19 additions and 2 deletions
@@ -557,6 +557,16 @@ export class DocumentsService {
throw Error("Move operation not permitted");
} else {
oldParent = item.parent_id;
const newParentId = content.parent_id;
const needRenameTo = await getItemName(
newParentId,
item.id,
item.name,
item.is_directory,
this.repository,
context,
);
if (needRenameTo !== item.name) renamedTo = item.name = needRenameTo;
}
if (key === "access_info") {
// if manage access is disabled, we don't allow changing access level