typo in app.py + clear input field on submit in web part
This commit is contained in:
parent
c7a4bc711d
commit
17b4224771
@ -28,8 +28,8 @@ def add_item():
|
||||
itemid = data.get('itemid')
|
||||
attributes = data.get('attributes', '').split(',') if data.get('attributes') else []
|
||||
|
||||
new_item = [(itemid, attributes)]
|
||||
extr = check_items(new_item)
|
||||
new_item = [itemid, attributes]
|
||||
extr = check_item(new_item)
|
||||
|
||||
if len(extr) > 0:
|
||||
skuid = list(extr.values())[0]["skuid"]
|
||||
|
@ -296,6 +296,10 @@ async function addItem() {
|
||||
attributes: document.getElementById("addattributes").value
|
||||
};
|
||||
|
||||
// clear input fields
|
||||
document.getElementById("additemid").value='';
|
||||
document.getElementById("addattributes").value='';
|
||||
|
||||
const requestOptions = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@ -312,6 +316,9 @@ async function addItem() {
|
||||
|
||||
if (response.ok) {
|
||||
console.log(response);
|
||||
// reload window to display new item
|
||||
location.reload();
|
||||
|
||||
} else {
|
||||
throw new Error('Error in server response');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user