This commit is contained in:
2026-07-30 10:30:50 +08:00
parent cf6d708566
commit 853c478657
85 changed files with 4711 additions and 1052 deletions
+3 -3
View File
@@ -51,7 +51,7 @@ async def create_supplier(
supplier = Supplier(**data)
db_session.add(supplier)
await db_session.commit()
await db_session.flush()
await db_session.refresh(supplier)
return SupplierResponse.from_orm(supplier)
@@ -71,7 +71,7 @@ async def update_supplier(
for key, value in supplier_data.dict().items():
setattr(supplier, key, value)
await db_session.commit()
await db_session.flush()
await db_session.refresh(supplier)
return SupplierResponse.from_orm(supplier)
@@ -88,5 +88,5 @@ async def delete_supplier(
raise HTTPException(status_code=404, detail="供应商不存在")
supplier.is_active = False
await db_session.commit()
await db_session.flush()
return {"message": "供应商已删除"}