feat(duty): add users/options endpoint filtered by duty staff role
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
0c4a4bf14a
commit
a8b5b69a1f
1 file changed
+12
@@ -61,6 +61,18 @@ def day_detail(
|
||||
return success_response(duty_svc.get_day_detail(db, tenant_no, d))
|
||||
|
||||
|
||||
@router.get("/users/options")
|
||||
def duty_user_options(
|
||||
_user: dict = Depends(require_admin_or_super_admin),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""值班可安排人员:仅「值班人员」角色下的启用用户。"""
|
||||
tenant_no = _user.get("tenant_no", "") or ""
|
||||
rows = duty_svc.list_duty_staff_users(db, tenant_no)
|
||||
out = [{"label": r["label"], "value": r["id"]} for r in rows]
|
||||
return success_response(out)
|
||||
|
||||
|
||||
@router.post("/day")
|
||||
def save_day(
|
||||
body: DutyDaySaveBody,
|
||||
|
||||
Reference in new issue
Block a user