Entferne Eigenschaft „active“

This commit is contained in:
Gonne 2022-08-29 23:03:57 +02:00
parent 766aedf22d
commit c7a9522c2c
2 changed files with 0 additions and 11 deletions

View file

@ -10,5 +10,4 @@ type CourseRepository interface {
FindByName(name string) (Course, error)
GetAll() ([]Course, error)
FindById(id int) (Course, error)
GetActive() ([]Course, error)
}

View file

@ -44,16 +44,6 @@ func (r *CourseRepo) GetAll() ([]models.Course, error) {
return r.getFromRows(rows)
}
func (r *CourseRepo) GetActive() ([]models.Course, error) {
rows, err := r.db.Query("SELECT * FROM course WHERE active")
if err != nil {
return nil, err
}
defer rows.Close()
return r.getFromRows(rows)
}
func (r *CourseRepo) getFromRows(rows *sql.Rows) ([]models.Course, error) {
var courses []models.Course
for rows.Next() {