Fix total count in page response

This commit is contained in:
Prathamesh Musale 2024-08-30 11:25:54 +05:30 committed by nabarun
parent 56ebd3aaa3
commit ef9129ecc0

View File

@ -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
}