refactored location patching
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user