From 05696f1579017a8a511a932fecd41ccb80e6d984 Mon Sep 17 00:00:00 2001 From: Rahmat Hidayat Date: Tue, 26 Mar 2024 14:09:03 +0700 Subject: [PATCH] fix: fix approvals pagination not returning paginated records --- internal/store/postgres/approval_repository.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/store/postgres/approval_repository.go b/internal/store/postgres/approval_repository.go index 5cba91de4..636c98ad0 100644 --- a/internal/store/postgres/approval_repository.go +++ b/internal/store/postgres/approval_repository.go @@ -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 {