Use correct HTTP error codes

This commit is contained in:
Thastertyn 2024-03-10 22:48:25 +01:00
parent 105bbd3e96
commit 031ed358f1

View File

@ -40,12 +40,12 @@ def create_product_listing():
price = request.json.get('price')
if name is None or price is None:
return abort(401)
return abort(400)
float_price = float(price)
if not isinstance(float_price, float):
return abort(401)
return abort(400)
result, status_code = ProductService.create_listing(user_id, name, float_price)