return empty orgminer results instead of UDE placeholder
This commit is contained in:
@@ -50,7 +50,7 @@ async def get_org_by_name(
|
||||
@router.get(
|
||||
"/get-hierarchy",
|
||||
operation_id="getHierarchy",
|
||||
response_model=list[dict],
|
||||
response_model=list[dict] | None,
|
||||
summary="Returns the hierarchy of organizations.",
|
||||
tags=[Tags.ORGMINER],
|
||||
)
|
||||
@@ -58,13 +58,13 @@ async def get_hierarchy(
|
||||
session:SessionDep,
|
||||
access_token_metadata: Annotated[
|
||||
AccessTokenMetadata, CurrentUserAccessTokenPayloadDep
|
||||
]) -> list[dict]:
|
||||
]) -> list[dict] | None:
|
||||
"""
|
||||
Returns the hierarchy of organizations.
|
||||
"""
|
||||
institution_id = _get_account_institution_id(session, access_token_metadata.effective_account_id)
|
||||
if not institution_id:
|
||||
institution_id = DEFAULT_INSTITUTION_ID
|
||||
return None
|
||||
|
||||
return await logic.get_hierarchy(institution_id)
|
||||
|
||||
@@ -83,14 +83,14 @@ async def get_orgminer_content(
|
||||
]) -> OrgminerContent | None:
|
||||
institution_id = _get_account_institution_id(session, access_token_metadata.effective_account_id)
|
||||
if not institution_id:
|
||||
institution_id = DEFAULT_INSTITUTION_ID
|
||||
return None
|
||||
return await logic.get_orgminer_content_verified_by_collab_graph(org_url,full_institution_url(institution_id))
|
||||
#return await logic.get_orgminer_content(org_url,full_institution_url(institution_id))
|
||||
|
||||
@router.get(
|
||||
"/classified-pages-aggs",
|
||||
operation_id="getClassifiedPagesAggs",
|
||||
response_model=list[CategoryBucket],
|
||||
response_model=list[CategoryBucket] | None,
|
||||
summary="Returns the aggregated categories of the classified pages of the orgminer org.",
|
||||
tags=[Tags.ORGMINER],
|
||||
)
|
||||
@@ -99,13 +99,13 @@ async def get_classified_pages_aggs(
|
||||
session:SessionDep,
|
||||
access_token_metadata: Annotated[
|
||||
AccessTokenMetadata, CurrentUserAccessTokenPayloadDep
|
||||
]) -> list[CategoryBucket]:
|
||||
]) -> list[CategoryBucket] | None:
|
||||
"""
|
||||
Returns the aggregated categories of the classified pages of the orgminer org.
|
||||
"""
|
||||
institution_id = _get_account_institution_id(session, access_token_metadata.effective_account_id)
|
||||
if not institution_id:
|
||||
institution_id = DEFAULT_INSTITUTION_ID
|
||||
return None
|
||||
return await logic.get_classified_pages_aggs(org_url,full_institution_url(institution_id))
|
||||
|
||||
@router.get(
|
||||
@@ -127,5 +127,5 @@ async def get_classified_pages(
|
||||
size: Annotated[int, Query(description="The number of items per page.", ge=1, le=100)] = 10,) -> ClassifiedPageResponse:
|
||||
institution_id = _get_account_institution_id(session, access_token_metadata.effective_account_id)
|
||||
if not institution_id:
|
||||
institution_id = DEFAULT_INSTITUTION_ID
|
||||
return ClassifiedPageResponse(total=0, pages=[])
|
||||
return await logic.get_classified_pages(org_url=org_url,institution_id=full_institution_url(institution_id),category=category,page=page,size=size)
|
||||
Reference in New Issue
Block a user