From 81c979886d37edcd294815f296deab2a0daa1c6e Mon Sep 17 00:00:00 2001 From: Glenn Wilkinson Date: Sat, 24 Oct 2020 12:01:08 +0200 Subject: [PATCH] Fixed bug for search filters to output number of records found --- controllers/api/group.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/api/group.go b/controllers/api/group.go index 56c58244..b92852a7 100644 --- a/controllers/api/group.go +++ b/controllers/api/group.go @@ -132,7 +132,7 @@ func (as *Server) Group(w http.ResponseWriter, r *http.Request) { } else { // Handle pagination for DataTable gs, _ := models.GetGroupSummary(id, ctx.Get(r, "user_id").(int64)) // We need to get the total number of records of the group - dT := models.DataTable{Draw: draw, RecordsTotal: gs.NumTargets, RecordsFiltered: gs.NumTargets} + dT := models.DataTable{Draw: draw, RecordsTotal: gs.NumTargets, RecordsFiltered: int64(len(g.Targets))} dT.Data = make([]interface{}, len(g.Targets)) // Pseudocode of 'dT.Data = g.Targets'. https://golang.org/doc/faq#convert_slice_of_interface for i, v := range g.Targets { dT.Data[i] = v