refactored location patching

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-10-22 22:45:14 +02:00
parent eafa7a5b5f
commit 8bf0790fca
3 changed files with 42 additions and 22 deletions

View File

@@ -60,8 +60,8 @@
}
async function move_dragged_to(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 data = draggedItem ? { item : draggedItem.id, target: new_loc.id } : { parent_location_id: new_loc.id }
const url = api(draggedItem ? 'stock/move_item' : `stock/location/${draggedLocation.id}`);
const res = await fetch(url,{
credentials : 'include',
method : 'PATCH',
@@ -125,10 +125,6 @@
onMount(load);
</script>
<style>
</style>
<h2>{t('Stock')}</h2>
<div class="grid3">
<div class="locations">
@@ -169,4 +165,4 @@
</div>
{/if}
{/await}
</div>
</div>