implemented moving of items

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-10-20 22:25:47 +02:00
parent b1517edc31
commit 715d2b0f31
5 changed files with 75 additions and 26 deletions

View File

@@ -23,7 +23,7 @@
let top_level = $state(null);
async function move_dragged_to(new_loc){
const data = { item : draggedItem, target: new_loc };
const data = { item : draggedItem.id, target: new_loc.id };
const url = api('stock/move_item');
const res = await fetch(url,{
credentials : 'include',
@@ -32,7 +32,10 @@
});
if (res.ok){
yikes();
} else error(res);
location = new_loc;
} else {
error(res);
}
}
async function loadLocation(){