working on referenceable locations
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user