mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: add specific org admin endpoint
This commit is contained in:
parent
283e5bc189
commit
4367a8a0fb
2 changed files with 60 additions and 5 deletions
|
|
@ -34,6 +34,7 @@ from src.services.orgs.orgs import (
|
|||
get_organization,
|
||||
get_organization_by_slug,
|
||||
get_orgs_by_user,
|
||||
get_orgs_by_user_admin,
|
||||
update_org,
|
||||
update_org_logo,
|
||||
update_org_signup_mechanism,
|
||||
|
|
@ -329,6 +330,22 @@ async def api_user_orgs(
|
|||
)
|
||||
|
||||
|
||||
@router.get("/user_admin/page/{page}/limit/{limit}")
|
||||
async def api_user_orgs_admin(
|
||||
request: Request,
|
||||
page: int,
|
||||
limit: int,
|
||||
current_user: PublicUser = Depends(get_current_user),
|
||||
db_session: Session = Depends(get_db_session),
|
||||
) -> List[OrganizationRead]:
|
||||
"""
|
||||
Get orgs by page and limit by current user
|
||||
"""
|
||||
return await get_orgs_by_user_admin(
|
||||
request, db_session, str(current_user.id), page, limit
|
||||
)
|
||||
|
||||
|
||||
@router.put("/{org_id}")
|
||||
async def api_update_org(
|
||||
request: Request,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue