fix issues
This commit is contained in:
@@ -18,14 +18,12 @@ const (
|
||||
competitionCachePrefix = "competition:"
|
||||
)
|
||||
|
||||
|
||||
type CompetitionRepository struct {
|
||||
db *sql.DB
|
||||
db *sql.DB
|
||||
redisClient *redis.Client
|
||||
cacheEnabled bool
|
||||
}
|
||||
|
||||
|
||||
func NewCompetitionRepository(db *sql.DB, redisClient *redis.Client, cacheEnabled bool) repository.CompetitionRepository {
|
||||
return &CompetitionRepository{
|
||||
db: db,
|
||||
@@ -149,7 +147,7 @@ func (r *CompetitionRepository) Delete(ctx context.Context, id uuid.UUID) error
|
||||
|
||||
return nil
|
||||
}
|
||||
func (r *CompetitionRepository) List(ctx context.Context, opts repository.ListCompetitionsOptions) ([]*domain.Competition, int, error) {
|
||||
func (r *CompetitionRepository) List(ctx context.Context, opts repository.ListCompetitionsOptions) ([]domain.Competition, int, error) {
|
||||
var args []interface{}
|
||||
var whereClauses []string
|
||||
argId := 1
|
||||
@@ -200,7 +198,7 @@ func (r *CompetitionRepository) List(ctx context.Context, opts repository.ListCo
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
var competitions []*domain.Competition
|
||||
var competitions []domain.Competition
|
||||
for rows.Next() {
|
||||
var c domain.Competition
|
||||
err := rows.Scan(
|
||||
@@ -219,7 +217,7 @@ func (r *CompetitionRepository) List(ctx context.Context, opts repository.ListCo
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
competitions = append(competitions, &c)
|
||||
competitions = append(competitions, c)
|
||||
}
|
||||
|
||||
return competitions, total, nil
|
||||
@@ -237,4 +235,4 @@ func (r *CompetitionRepository) ChangeState(ctx context.Context, id uuid.UUID, s
|
||||
}
|
||||
|
||||
return r.Get(ctx, id)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user