Skip to content

Commit

Permalink
fix: fix approvals pagination not returning paginated records
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmatrhd committed Mar 26, 2024
1 parent 2020b15 commit 05696f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/store/postgres/approval_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ func (r *ApprovalRepository) ListApprovals(ctx context.Context, filter *domain.L

func (r *ApprovalRepository) GetApprovalsTotalCount(ctx context.Context, filter *domain.ListApprovalsFilter) (int64, error) {
db := r.db.WithContext(ctx)
f := filter
f := *filter
f.Size = 0
f.Offset = 0
db = applyFilter(db, f)
db = applyFilter(db, &f)

var count int64
if err := db.Model(&model.Approval{}).Count(&count).Error; err != nil {
Expand Down

0 comments on commit 05696f1

Please sign in to comment.