Skip to content

Commit 73005c2

Browse files
committed
fix(registration_event): where id to total count
1 parent e9fae96 commit 73005c2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/events/repository/list_registration_by_event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func (repo *repository) ListRegistrationByEvent(ctx context.Context, eventID uint, filterPagination domain.FilterPagination) (data []domain.RegistrationEvent, totalCount int64, err error) {
11-
if err := repo.db.DB(ctx).Model(&domain.RegistrationEvent{}).Count(&totalCount).Error; err != nil {
11+
if err := repo.db.DB(ctx).Model(&domain.RegistrationEvent{}).Where("event_id = ?", eventID).Count(&totalCount).Error; err != nil {
1212
logrus.Error("failed to count blog posts: ", err)
1313
return nil, 0, err
1414
}

0 commit comments

Comments
 (0)