diff options
author | ShaabanEltanany <shaaban.eltanany.ext@orange.com> | 2020-05-05 11:01:44 +0200 |
---|---|---|
committer | ShaabanEltanany <shaaban.eltanany.ext@orange.com> | 2020-05-05 11:01:44 +0200 |
commit | f486ab15c64375a2c97df979a718929420124cd6 (patch) | |
tree | b5fcfbbe4c48e438e2c50129ca60dd0fc1ecfb91 /ms/blueprintsprocessor/modules/inbounds/designer-api | |
parent | 6b6ac70007ba2b52c6beb8c0d22453a628c891f3 (diff) |
fix sort at package list
Issue-ID: CCSDK-2320
Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com>
Change-Id: Ia91d519c315b6ef0c01089422253599b137eceec
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds/designer-api')
-rw-r--r-- | ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt | 12 |
1 files changed, 8 insertions, 4 deletions
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<BlueprintModelSearch> { - 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<BlueprintModelSearch> { - 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) } |