Skip to content

Commit

Permalink
DH-4482 fix missing organization id (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
DishenWang2023 committed May 7, 2024
1 parent 9ab7dd8 commit bc3247d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions apps/ai/server/modules/organization/controller.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from fastapi import APIRouter, status

from modules.organization.models.requests import OrganizationRequest
from modules.organization.models.responses import OrganizationResponse
from modules.organization.service import OrganizationService

router = APIRouter(
Expand All @@ -12,12 +13,12 @@


@router.get("/list")
async def list_organizations() -> list[OrganizationRequest]:
async def list_organizations() -> list[OrganizationResponse]:
return org_service.list_organizations()


@router.get("/{id}")
async def get_organization(id: str) -> OrganizationRequest:
async def get_organization(id: str) -> OrganizationResponse:
return org_service.get_organization(id)


Expand All @@ -29,10 +30,10 @@ async def delete_organization(id: str):
@router.put("/{id}")
async def update_organization(
id: str, org_request: OrganizationRequest
) -> OrganizationRequest:
) -> OrganizationResponse:
return org_service.update_organization(id, org_request)


@router.post("/", status_code=status.HTTP_201_CREATED)
async def add_organization(org_request: OrganizationRequest) -> OrganizationRequest:
async def add_organization(org_request: OrganizationRequest) -> OrganizationResponse:
return org_service.add_organization(org_request)
2 changes: 1 addition & 1 deletion apps/ai/server/modules/organization/models/responses.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from modules.organization.models.entities import Organization


class OrganizationRequest(Organization):
class OrganizationResponse(Organization):
pass

0 comments on commit bc3247d

Please sign in to comment.