implemented moving of locations
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -60,7 +60,6 @@
|
||||
}
|
||||
|
||||
async function move_dragged_to(new_loc){
|
||||
console.log({move_dragged_to:JSON.parse(JSON.stringify(new_loc))});
|
||||
const data = draggedItem ? { item : draggedItem.id, target: new_loc.id } : { location : draggedLocation.id, target: new_loc.id }
|
||||
const url = api(draggedItem ? 'stock/move_item' : 'stock/move_location');
|
||||
const res = await fetch(url,{
|
||||
@@ -70,7 +69,14 @@
|
||||
});
|
||||
if (res.ok){
|
||||
yikes();
|
||||
location = new_loc;
|
||||
location = new_loc;
|
||||
if (!draggedItem){
|
||||
for (var owner of top_level){
|
||||
if (owner.locations && dropNestedLocation(owner.locations,draggedLocation)) break;
|
||||
}
|
||||
}
|
||||
draggedItem = null;
|
||||
draggedLocation = null;
|
||||
} else {
|
||||
error(res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user