diff options
author | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-12-13 14:26:23 +0700 |
---|---|---|
committer | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-12-14 09:34:22 +0700 |
commit | 9ee674a4798cf191a5833ff7703ad497db620fce (patch) | |
tree | ff824b8954230dbc82c4851b40ed1dff6caca368 /src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala | |
parent | 2664b915a044f7bc5eda2722145ebe978d9adf1a (diff) | |
download | rest-query-9ee674a4798cf191a5833ff7703ad497db620fce.tar.gz rest-query-9ee674a4798cf191a5833ff7703ad497db620fce.tar.bz2 rest-query-9ee674a4798cf191a5833ff7703ad497db620fce.zip |
PDSUI-2432 Review fixes
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala index 5a54cca..77f12f9 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestPatientService.scala @@ -1,13 +1,11 @@ package xyz.driver.pdsuidomain.services.rest -import java.time.LocalDateTime - import scala.concurrent.{ExecutionContext, Future} import akka.http.scaladsl.model._ import akka.stream.Materializer import xyz.driver.core.rest.{Pagination => _, _} import xyz.driver.entities.users.AuthUserInfo -import xyz.driver.pdsuicommon.db._ +import xyz.driver.pdsuicommon.db.{Pagination, _} import xyz.driver.pdsuicommon.domain._ import xyz.driver.pdsuidomain.ListResponse import xyz.driver.pdsuidomain.entities._ @@ -34,16 +32,16 @@ class RestPatientService(transport: ServiceTransport, baseUri: Uri)(implicit pro def getAll(filter: SearchFilterExpr = SearchFilterExpr.Empty, sorting: Option[Sorting] = None, - pagination: Option[Pagination] = None)( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[(Seq[Patient], Int, Option[LocalDateTime])] = { + pagination: Pagination = Pagination.Default)( + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[ListResponse[Patient]] = { val request = HttpRequest( HttpMethods.GET, - endpointUri(baseUri, "/v1/patient", filterQuery(filter) ++ sortingQuery(sorting) ++ paginationQuery(pagination))) + endpointUri(baseUri, "/v1/patient", filterQuery(filter) ++ sortingQuery(sorting) ++ paginationQuery(Some(pagination)))) for { response <- transport.sendRequestGetResponse(requestContext)(request) reply <- apiResponse[ListResponse[Patient]](response) } yield { - (reply.items, reply.meta.itemsCount, reply.meta.lastUpdate) + reply } } |