feat: Folder move order by name
parent
9fb5e2a084
commit
26a3067992
|
|
@ -189,6 +189,7 @@ class FolderSerializer(serializers.Serializer):
|
||||||
field in instance and instance.get(field) is not None)}
|
field in instance and instance.get(field) is not None)}
|
||||||
|
|
||||||
QuerySet(Folder).filter(id=current_id).update(**edit_dict)
|
QuerySet(Folder).filter(id=current_id).update(**edit_dict)
|
||||||
|
current_node.refresh_from_db()
|
||||||
|
|
||||||
if parent_id is not None and current_id != current_node.workspace_id and current_node.parent_id != parent_id:
|
if parent_id is not None and current_id != current_node.workspace_id and current_node.parent_id != parent_id:
|
||||||
|
|
||||||
|
|
@ -204,7 +205,9 @@ class FolderSerializer(serializers.Serializer):
|
||||||
workspace_id=current_node.workspace_id).exists():
|
workspace_id=current_node.workspace_id).exists():
|
||||||
raise serializers.ValidationError(_('Folder name already exists'))
|
raise serializers.ValidationError(_('Folder name already exists'))
|
||||||
|
|
||||||
current_node.move_to(parent)
|
current_node.parent = parent
|
||||||
|
current_node.save()
|
||||||
|
current_node.refresh_from_db()
|
||||||
else:
|
else:
|
||||||
raise AppApiException(403, _('No permission for the target folder'))
|
raise AppApiException(403, _('No permission for the target folder'))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,6 @@ const handleDrop = (draggingNode: any, dropNode: any, dropType: string, ev: Drag
|
||||||
emit('refreshTree')
|
emit('refreshTree')
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
MsgError(t('components.folder.requiredMessage'))
|
|
||||||
emit('refreshTree')
|
emit('refreshTree')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue