mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: org wide ai features check
This commit is contained in:
parent
de93d56945
commit
077c26ce15
24 changed files with 573 additions and 163 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from typing import List
|
||||
from fastapi import APIRouter, Depends, Request, UploadFile
|
||||
from sqlmodel import Session
|
||||
from src.db.organization_config import OrganizationConfigBase
|
||||
from src.db.users import PublicUser
|
||||
from src.db.organizations import (
|
||||
Organization,
|
||||
|
|
@ -12,6 +13,7 @@ from src.core.events.database import get_db_session
|
|||
from src.security.auth import get_current_user
|
||||
from src.services.orgs.orgs import (
|
||||
create_org,
|
||||
create_org_with_config,
|
||||
delete_org,
|
||||
get_organization,
|
||||
get_organization_by_slug,
|
||||
|
|
@ -37,6 +39,23 @@ async def api_create_org(
|
|||
return await create_org(request, org_object, current_user, db_session)
|
||||
|
||||
|
||||
# Temporary pre-alpha code
|
||||
@router.post("/withconfig/")
|
||||
async def api_create_org_withconfig(
|
||||
request: Request,
|
||||
org_object: OrganizationCreate,
|
||||
config_object: OrganizationConfigBase,
|
||||
current_user: PublicUser = Depends(get_current_user),
|
||||
db_session: Session = Depends(get_db_session),
|
||||
) -> OrganizationRead:
|
||||
"""
|
||||
Create new organization
|
||||
"""
|
||||
return await create_org_with_config(
|
||||
request, org_object, current_user, db_session, config_object
|
||||
)
|
||||
|
||||
|
||||
@router.get("/{org_id}")
|
||||
async def api_get_org(
|
||||
request: Request,
|
||||
|
|
@ -110,7 +129,7 @@ async def api_update_org(
|
|||
"""
|
||||
Update Org by ID
|
||||
"""
|
||||
return await update_org(request, org_object,org_id, current_user, db_session)
|
||||
return await update_org(request, org_object, org_id, current_user, db_session)
|
||||
|
||||
|
||||
@router.delete("/{org_id}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue