mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 19:13:08 +00:00
filter out move operations where source and target are the same
This commit is contained in:
@@ -372,10 +372,14 @@ export class SectionFormOperationsService {
|
||||
pathCombiner.getPath(segmentedPath),
|
||||
value, true);
|
||||
} else {
|
||||
this.operationsBuilder.move(
|
||||
pathCombiner.getPath(path),
|
||||
pathCombiner.getPath(segmentedPath + '/' + event.$event.previousIndex).path
|
||||
)
|
||||
const moveTo = pathCombiner.getPath(path);
|
||||
const moveFrom = pathCombiner.getPath(segmentedPath + '/' + event.$event.previousIndex);
|
||||
if (isNotEmpty(moveFrom.path) && isNotEmpty(moveTo.path) && moveFrom.path !== moveTo.path) {
|
||||
this.operationsBuilder.move(
|
||||
moveTo,
|
||||
moveFrom.path
|
||||
)
|
||||
}
|
||||
}
|
||||
} else if (!value.hasValue()) {
|
||||
// New value is empty, so dispatch a remove operation
|
||||
|
Reference in New Issue
Block a user