Add user creation and update functionality; refactor user template and helpers
This commit is contained in:
parent
f4369348c5
commit
26e55b9a3e
6 changed files with 134 additions and 24 deletions
|
@ -157,7 +157,7 @@
|
|||
const id = document.querySelector("#inventoryId").value;
|
||||
const isEdit = id && id !== "None";
|
||||
|
||||
const endpoint = isEdit ? `/api/inventory/${id}` : "/api/inventory"
|
||||
const endpoint = isEdit ? `/api/inventory/${id}` : "/api/inventory";
|
||||
const method = isEdit ? "PUT" : "POST";
|
||||
|
||||
const response = await fetch(endpoint, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue