feat(dashboard): reconstruct backend router/service, register route, fix suppliers NameError

This commit is contained in:
fatemeh sane
2026-10-08 11:18:47 +03:30
parent d84637769a
commit b82c039265
4 changed files with 877 additions and 19 deletions
-19
View File
@@ -122,25 +122,6 @@ async def delete_supplier_material(
return {"data": {"supplier_id": str(supplier_id), "material_id": str(material_id), "deleted": True}}
@router.get("/materials/{material_id}/suppliers")
async def list_material_suppliers(
material_id,
page: int = Query(1, ge=1),
page_size: int = Query(20, ge=1, le=100),
db: AsyncSession = Depends(get_db),
):
async with db.begin():
await unlink_supplier_material(db, supplier_id, material_id)
return {
"data": {
"supplier_id": str(supplier_id),
"material_id": str(material_id),
"deleted": True,
}
}
# ---------------------------------------------------------------------------
# GET /materials/{material_id}/suppliers
# ---------------------------------------------------------------------------