fix for ship logical delete server-side
This commit is contained in:
parent
1a3146cf85
commit
3455139c74
@ -53,12 +53,16 @@ def PutShip():
|
|||||||
@auth_guard() # no restriction by role
|
@auth_guard() # no restriction by role
|
||||||
def DeleteShip():
|
def DeleteShip():
|
||||||
|
|
||||||
|
# TODO check if I am allowed to delete this thing by deriving the participant from the bearer token
|
||||||
try:
|
try:
|
||||||
content = request.get_json(force=True)
|
if 'id' in request.args:
|
||||||
loadedModel = model.ShipSchema().load(data=content, many=False, partial=True, unknown=EXCLUDE)
|
options = {}
|
||||||
|
options["id"] = request.args.get("id")
|
||||||
|
else:
|
||||||
|
return json.dumps("no id provided"), 400
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logging.error(ex)
|
logging.error(ex)
|
||||||
print(ex)
|
print(ex)
|
||||||
return json.dumps("bad format"), 400
|
return json.dumps("bad format"), 400
|
||||||
|
|
||||||
return impl.ships.DeleteShip(loadedModel)
|
return impl.ships.DeleteShip(options)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user