working on referenceable locations

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-11-03 20:16:57 +01:00
parent 8e10909c81
commit 71d9a4b15f
6 changed files with 88 additions and 54 deletions

View File

@@ -1,5 +1,5 @@
<script>
import { api } from '../../urls.svelte';
import { api, get } from '../../urls.svelte';
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte';
@@ -41,7 +41,7 @@
delete location.locations;
} else {
const url = api(`stock/locations/below/${location.id}`);
const res = await fetch(url,{credentials:'include'});
const res = await get(url);
if (res.ok){
yikes();
location.locations = await res.json();
@@ -67,11 +67,7 @@
parent: parent
}
const url = api('stock/location');
const res = await fetch(url,{
credentials: 'include',
method: 'POST',
body: JSON.stringify(data)
});
const res = await post(url,data);
if (res.ok){
yikes;
const saved = await res.json();