delete list interactivity + fix create empty list

This commit is contained in:
2024-02-19 00:49:36 +01:00
parent 094439eb73
commit ba72d8bd35
7 changed files with 109 additions and 26 deletions

View File

@ -72,8 +72,9 @@ def createList():
items = data.get('items')
list_uuid = create_list(name, description)
if list_uuid:
for item in items.split('#'):
add_to_list(list_uuid, item)
if len(items)>0 :
for item in items.split('#'):
add_to_list(list_uuid, item)
return jsonify({'created list ': name}), 200
else:
return jsonify({'create failed': name}), 400

View File

@ -270,7 +270,7 @@ def delete_list(list_uuid):
DELETE
FROM itemlist
WHERE uuid = %s
""", (uuid,))
""", (list_uuid,))
cursor.close()
connection.commit()
connection.close()