Co-authored-by: svlandeg <svlandeg@github.com>
@app.post("/items/")
async def create_item(item: Item):
item_dict = item.dict()
- if item.tax:
+ if item.tax is not None:
price_with_tax = item.price + item.tax
item_dict.update({"price_with_tax": price_with_tax})
return item_dict
@app.post("/items/")
async def create_item(item: Item):
item_dict = item.dict()
- if item.tax:
+ if item.tax is not None:
price_with_tax = item.price + item.tax
item_dict.update({"price_with_tax": price_with_tax})
return item_dict