implemented moving of locations

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-10-22 21:16:25 +02:00
parent 7b259e7425
commit eafa7a5b5f
4 changed files with 38 additions and 5 deletions

View File

@@ -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);
}