galovics commented on code in PR #2659:
URL: https://github.com/apache/fineract/pull/2659#discussion_r995496106
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/api/DatatablesApiResource.java:
##########
@@ -218,6 +226,55 @@ public String getDatatable(@PathParam("datatable")
@Parameter(description = "dat
return this.toApiJsonSerializer.serializePretty(prettyPrint, result);
}
+ @GET
+ @Path("{datatable}/query")
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Query Data Table values", description = "Query
values from a registered data table.")
+ @ApiResponses({
+ @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation = List.class))) })
+ public String queryValues(@PathParam("datatable") @Parameter(description =
"datatable") final String datatable,
+ @QueryParam("columnFilter") @Parameter(description =
"columnFilter") final String columnFilter,
+ @QueryParam("valueFilter") @Parameter(description = "valueFilter")
final String valueFilter,
+ @QueryParam("resultColumns") @Parameter(description =
"resultColumns") final String resultColumns,
+ @Context final UriInfo uriInfo) {
+
this.context.authenticatedUser().validateHasDatatableReadPermission(datatable);
+ List<String> dataTableColumnNames =
genericDataService.fillResultsetColumnHeaders(datatable).stream()
Review Comment:
It's a matter of design overall in the codebase. It's one level deeper and
as I said in another comment, right now the validation logic is scattered
between this level and the service layer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]