Skip to content

Commit

Permalink
Do not return the total record count (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
dehort authored Nov 22, 2024
1 parent e13bb97 commit b3d2ed7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/queries/queries_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var RetrievePayloads = func(dbQuery *gorm.DB, page int, pageSize int, apiQuery s

orderString := fmt.Sprintf("%s %s", apiQuery.SortBy, apiQuery.SortDir)

dbQuery.Model(&payloads).Count(&count)
//dbQuery.Model(&payloads).Count(&count)
dbQuery.Order(orderString).Limit(pageSize).Offset(pageSize * page).Find(&payloads)

return count, payloads
Expand Down Expand Up @@ -158,7 +158,7 @@ var RetrieveStatuses = func(dbQuery *gorm.DB, apiQuery structs.Query) (int64, []
dbQuery = chainTimeConditions("payload_statuses.created_at", apiQuery, dbQuery)

orderString := fmt.Sprintf("%s %s", apiQuery.SortBy, apiQuery.SortDir)
dbQuery.Model(&payloads).Count(&count)
//dbQuery.Model(&payloads).Count(&count)
dbQuery.Order(orderString).Limit(pageSize).Offset(pageSize * page).Scan(&payloads)

return count, payloads
Expand Down

0 comments on commit b3d2ed7

Please sign in to comment.