Updated vendor API to correct issues - Implement new UI

This commit is contained in:
Matt Gerega
2024-03-26 21:26:41 -04:00
parent e68f88da2a
commit 3aed735cea
9 changed files with 62 additions and 9 deletions

View File

@@ -33,6 +33,11 @@ class VendorParameters(BaseModel):
description="Free text comment about this vendor.",
example="",
)
empty_spool_weight: Optional[float] = Field(
ge=0,
description="The weight of an empty spool.",
example=200,
)
extra: Optional[dict[str, str]] = Field(
None,
description="Extra fields for this vendor.",
@@ -41,11 +46,6 @@ class VendorParameters(BaseModel):
class VendorUpdateParameters(VendorParameters):
name: Optional[str] = Field(max_length=64, description="Vendor name.", example="Polymaker")
comment: Optional[str] = Field(
max_length=1024,
description="Free text comment about this vendor.",
example="",
)
@router.get(
@@ -190,6 +190,7 @@ async def create( # noqa: ANN201
db=db,
name=body.name,
comment=body.comment,
empty_spool_weight=body.empty_spool_weight,
extra=body.extra,
)