add option to use measured or remaining weight

This commit is contained in:
Thomas White
2023-08-20 12:00:29 +08:00
parent 2fcfc3814f
commit eea74b8a43
3 changed files with 161 additions and 9 deletions

View File

@@ -158,11 +158,11 @@ async def create( # noqa: ANN201
db: Annotated[AsyncSession, Depends(get_db_session)],
body: SpoolParameters,
):
if body.remaining_weight is not None and body.used_weight is not None:
return JSONResponse(
status_code=400,
content={"message": "Only specify either remaining_weight or used_weight."},
)
#if body.remaining_weight is not None and body.used_weight is not None:
# return JSONResponse(
# status_code=400,
# content={"message": "Only specify either remaining_weight or used_weight."},
# )
try:
db_item = await spool.create(