added duplicate items check on POST

This commit is contained in:
ak 2023-11-29 18:40:16 -08:00
parent 9a9e6ac209
commit 28a259e80e

View file

@ -197,9 +197,9 @@ def post():
stores = fetchStores()
if not stores: abort(404)
store = stores[0]
###
### HERE WE NEED TO CHECK IF ITEM ALREADY EXISTS
###
# check for existence of duplicate item
found = fetchItems(store)
if (found): abort(409)
# let's create the record
item = {
'name': request.args['itemName'],