fixed wrong endpoint recognition in institute autocompletion
This commit is contained in:
@@ -18,7 +18,7 @@ from . import logic
|
||||
from inse.institutions.institutions_search_client import InstitutionsSearchClient
|
||||
|
||||
|
||||
router = APIRouter(prefix="/api/institutions", tags=[Tags.INSTITUTIONS])
|
||||
router = APIRouter(prefix="/api/inse-service/institutions", tags=[Tags.INSTITUTIONS])
|
||||
|
||||
|
||||
@lru_cache
|
||||
@@ -35,28 +35,6 @@ def get_institutions_search_client() -> InstitutionsSearchClient:
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/{id}",
|
||||
summary="Returns a single institution by ID.",
|
||||
description="Returns a single institution by its OpenAlex ID.",
|
||||
operation_id="getInstitutionById",
|
||||
responses={
|
||||
status.HTTP_200_OK: {
|
||||
"description": "Successful Response",
|
||||
"model": Institution,
|
||||
},
|
||||
status.HTTP_404_NOT_FOUND: {"description": "Institution not found"},
|
||||
},
|
||||
)
|
||||
async def get_institution(
|
||||
id: str,
|
||||
client: Annotated[
|
||||
InstitutionsSearchClient, Depends(get_institutions_search_client)
|
||||
],
|
||||
) -> Institution:
|
||||
return await logic.get_institution_by_id(raw_institution_id=id, client=client)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/autocomplete",
|
||||
operation_id="autocompleteInstitutions",
|
||||
@@ -155,3 +133,26 @@ async def list_institutions(
|
||||
sample=sample,
|
||||
select=select,
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/{id}",
|
||||
summary="Returns a single institution by ID.",
|
||||
description="Returns a single institution by its OpenAlex ID.",
|
||||
operation_id="getInstitutionById",
|
||||
responses={
|
||||
status.HTTP_200_OK: {
|
||||
"description": "Successful Response",
|
||||
"model": Institution,
|
||||
},
|
||||
status.HTTP_404_NOT_FOUND: {"description": "Institution not found"},
|
||||
},
|
||||
)
|
||||
async def get_institution(
|
||||
id: str,
|
||||
client: Annotated[
|
||||
InstitutionsSearchClient, Depends(get_institutions_search_client)
|
||||
],
|
||||
) -> Institution:
|
||||
return await logic.get_institution_by_id(raw_institution_id=id, client=client)
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export class InstitutionsService extends BaseService {
|
||||
|
||||
/**
|
||||
* Returns institution options for autocomplete inputs.
|
||||
* @endpoint get /api/institutions/autocomplete
|
||||
* @endpoint get /api/inse-service/institutions/autocomplete
|
||||
* @param query Institution search text, for example \'Duisburg Essen\'.
|
||||
* @param countryCode Optional ISO country code filter.
|
||||
* @param type Optional institution type filter.
|
||||
@@ -94,7 +94,7 @@ export class InstitutionsService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/institutions/autocomplete`;
|
||||
let localVarPath = `/api/inse-service/institutions/autocomplete`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<AutocompleteResponse>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
@@ -113,7 +113,7 @@ export class InstitutionsService extends BaseService {
|
||||
/**
|
||||
* Returns a single institution by ID.
|
||||
* Returns a single institution by its OpenAlex ID.
|
||||
* @endpoint get /api/institutions/{id}
|
||||
* @endpoint get /api/inse-service/institutions/{id}
|
||||
* @param id
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
@@ -151,7 +151,7 @@ export class InstitutionsService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
|
||||
let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Institution>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
@@ -168,7 +168,7 @@ export class InstitutionsService extends BaseService {
|
||||
|
||||
/**
|
||||
* Returns a list of OpenAlex institutions.
|
||||
* @endpoint get /api/institutions
|
||||
* @endpoint get /api/inse-service/institutions
|
||||
* @param search Full-text search, for example \'Duisburg Essen\'.
|
||||
* @param filter OpenAlex filter, for example \'country_code:DE,type:education\'.
|
||||
* @param sort Sort field, for example \'works_count:desc\'.
|
||||
@@ -231,7 +231,7 @@ export class InstitutionsService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/api/institutions`;
|
||||
let localVarPath = `/api/inse-service/institutions`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<InstitutionsListResponse>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user