diff --git a/Makefile b/Makefile index 25016ff4e..b7ccffb35 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ help: @echo "│ test-frontend Run frontend tests │" @echo "│ │" @echo "│ dev-frontend Run frontend in development mode │" - @echo "│ dev-backend Run backend in development mode │" + @echo "│ dev-api Run api in development mode │" @echo "│ │" @echo "│ docker-build Build docker image │" @echo "│ docker-push Push docker image │" diff --git a/backend/src/monarch_py/api/entity.py b/backend/src/monarch_py/api/entity.py index 216d2bfaa..2ae2c6451 100644 --- a/backend/src/monarch_py/api/entity.py +++ b/backend/src/monarch_py/api/entity.py @@ -1,4 +1,5 @@ -from fastapi import APIRouter, HTTPException, Query +from fastapi import APIRouter, Depends, HTTPException, Query +from monarch_py.api.additional_models import PaginationParams from monarch_py.api.config import settings from monarch_py.datamodels.model import AssociationTableResults, Node from monarch_py.implementations.solr.solr_implementation import SolrImplementation @@ -49,6 +50,7 @@ def _association_table( title="Type of association to retrieve association table data for", ), query: str = Query(None, example="thumb", title="Query string to limit results to a subset"), + pagination: PaginationParams = Depends(), ) -> AssociationTableResults: """ Retrieves association table data for a given entity and association type @@ -61,6 +63,12 @@ def _association_table( AssociationResults: Association table data for the specified entity and association type """ solr = SolrImplementation(base_url=settings.solr_url) - response = solr.get_association_table(entity=id, category=category, q=query) + response = solr.get_association_table( + entity=id, + category=category, + q=query, + offset=pagination.offset, + limit=pagination.limit + ) return response