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

@@ -19,6 +19,7 @@ async def create(
db: AsyncSession,
name: Optional[str] = None,
comment: Optional[str] = None,
empty_spool_weight: Optional[float] = None,
extra: Optional[dict[str, str]] = None,
) -> models.Vendor:
"""Add a new vendor to the database."""
@@ -26,6 +27,7 @@ async def create(
name=name,
registered=datetime.utcnow().replace(microsecond=0),
comment=comment,
empty_spool_weight=empty_spool_weight,
extra=[models.VendorField(key=k, value=v) for k, v in (extra or {}).items()],
)
db.add(vendor)