Skip to content
Snippets Groups Projects
Verified Commit 96976c47 authored by hanfi's avatar hanfi
Browse files

check delviery and storage on item checkin

parent 6881f9e3
Branches
No related tags found
1 merge request!8backend api v2
This commit is part of merge request !8. Comments created here will be created in the context of that merge request.
...@@ -150,8 +150,12 @@ def add_item( ...@@ -150,8 +150,12 @@ def add_item(
db: Session = Depends(get_db), db: Session = Depends(get_db),
): ):
check_token(token, None) check_token(token, None)
print(item) delivery = utils.get_delivery_by_uuid(db, item.delivery_uuid)
storage = utils.get_storage_by_name(db, item.storage_name)
if not delivery:
raise HTTPException(status_code=404, detail="Delivery not found")
if not storage:
raise HTTPException(status_code=404, detail="Storage not found")
return utils.add_item_for_delivery_at_storage( return utils.add_item_for_delivery_at_storage(
db, item.delivery_uuid, item.storage_name db, item.delivery_uuid, item.storage_name
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment