implemented creating new stock items
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -8,11 +8,13 @@
|
||||
|
||||
async function saveNewItem(){
|
||||
newItem.location = location;
|
||||
console.log(JSON.parse(JSON.stringify(newItem)));
|
||||
const url = api('stock/item');
|
||||
const res = post(url,newItem);
|
||||
const res = await post(url,newItem);
|
||||
if (res.ok) {
|
||||
yikes();
|
||||
const it = await res.json();
|
||||
console.log(it);
|
||||
items = [...items, it];
|
||||
} else error(res);
|
||||
}
|
||||
</script>
|
||||
@@ -27,7 +29,7 @@
|
||||
<tbody>
|
||||
{#each items as item}
|
||||
<tr onclick={ev => selected = item} ondragstart={e => drag_start(item)} draggable="true">
|
||||
<td>{item.id}</td>
|
||||
<td title={`db id: ${item.id}`}>{item.owner_number}</td>
|
||||
<td>{item.code}</td>
|
||||
<td>{item.name}</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user