added duplicate items check on POST
This commit is contained in:
parent
9a9e6ac209
commit
28a259e80e
1 changed files with 3 additions and 3 deletions
|
|
@ -197,9 +197,9 @@ def post():
|
||||||
stores = fetchStores()
|
stores = fetchStores()
|
||||||
if not stores: abort(404)
|
if not stores: abort(404)
|
||||||
store = stores[0]
|
store = stores[0]
|
||||||
###
|
# check for existence of duplicate item
|
||||||
### HERE WE NEED TO CHECK IF ITEM ALREADY EXISTS
|
found = fetchItems(store)
|
||||||
###
|
if (found): abort(409)
|
||||||
# let's create the record
|
# let's create the record
|
||||||
item = {
|
item = {
|
||||||
'name': request.args['itemName'],
|
'name': request.args['itemName'],
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue