mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: Folder move order by name
This commit is contained in:
parent
9fb5e2a084
commit
26a3067992
|
|
@ -189,6 +189,7 @@ class FolderSerializer(serializers.Serializer):
|
|||
field in instance and instance.get(field) is not None)}
|
||||
|
||||
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:
|
||||
|
||||
|
|
@ -204,7 +205,9 @@ class FolderSerializer(serializers.Serializer):
|
|||
workspace_id=current_node.workspace_id).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:
|
||||
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')
|
||||
})
|
||||
.catch(() => {
|
||||
MsgError(t('components.folder.requiredMessage'))
|
||||
emit('refreshTree')
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue