activity: add filtered count route
separated the search parts of ServerSearchReqDTO into ServerFilterReqDTO, factored out part of GetActivities that made the (filtering) query, which is then used in GetFilteredActivityCount with db.Count.
This commit is contained in:
@@ -499,6 +499,11 @@ func (q *QueryDTO) UnmarshalJSON(data []byte) error {
|
||||
// ServerSearchReqDTO is a usual PaginatedReqDTO with added fields for searching and filtering.
|
||||
type ServerSearchReqDTO struct {
|
||||
PaginatedReqDTO
|
||||
ServerFilterReqDTO
|
||||
}
|
||||
|
||||
// ServerFilterReqDTO provides search terms and queries to a search or count route.
|
||||
type ServerFilterReqDTO struct {
|
||||
SearchTerms []string `json:"searchTerms"`
|
||||
Queries []QueryDTO `json:"queries"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user