From f486ab15c64375a2c97df979a718929420124cd6 Mon Sep 17 00:00:00 2001 From: ShaabanEltanany Date: Tue, 5 May 2020 11:01:44 +0200 Subject: fix sort at package list Issue-ID: CCSDK-2320 Signed-off-by: ShaabanEltanany Change-Id: Ia91d519c315b6ef0c01089422253599b137eceec --- .../designer/api/BlueprintModelController.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/designer-api/src') diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt index 1f01d1ce3..3973f3620 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt @@ -89,9 +89,11 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint fun allBlueprintModel( @RequestParam(defaultValue = "20") limit: Int, @RequestParam(defaultValue = "0") offset: Int, - @RequestParam(defaultValue = "DATE") sort: BlueprintSortByOption + @RequestParam(defaultValue = "DATE") sort: BlueprintSortByOption, + @RequestParam(defaultValue = "ASC") sortType: String ): Page { - val pageRequest = PageRequest.of(offset, limit, Sort.Direction.ASC, sort.columnName) + val pageRequest = PageRequest.of(offset, limit, + Sort.Direction.fromString(sortType), sort.columnName) return this.bluePrintModelHandler.allBlueprintModel(pageRequest) } @@ -110,9 +112,11 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint @NotNull @PathVariable(value = "keyword") keyWord: String, @RequestParam(defaultValue = "20") limit: Int, @RequestParam(defaultValue = "0") offset: Int, - @RequestParam(defaultValue = "DATE") sort: BlueprintSortByOption + @RequestParam(defaultValue = "DATE") sort: BlueprintSortByOption, + @RequestParam(defaultValue = "ASC") sortType: String ): Page { - val pageRequest = PageRequest.of(offset, limit, Sort.Direction.ASC, sort.columnName) + val pageRequest = PageRequest.of(offset, limit, + Sort.Direction.fromString(sortType), sort.columnName) return this.bluePrintModelHandler.searchBluePrintModelsByKeyWordPaged(keyWord, pageRequest) } -- cgit 1.2.3-korg