Add pagination for query to get records #58
@ -770,7 +770,7 @@ func paginate[T any](data []T, pagination *query.PageRequest) ([]T, *query.PageR
|
||||
paginatedItems := data[start:end]
|
||||
|
||||
if countTotal {
|
||||
return paginatedItems, &query.PageResponse{Total: end - start}
|
||||
return paginatedItems, &query.PageResponse{Total: totalItems}
|
||||
} else {
|
||||
return paginatedItems, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user