diff options
Diffstat (limited to '')
-rw-r--r-- | courses.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -105,10 +105,15 @@ func setupCourses() error { if err != nil { return fmt.Errorf("error fetching courses: %w", err) } + err := db.QueryRow(context.Background(), + "SELECT COUNT (*) FROM choices WHERE courseid = $1", + currentCourse.ID, + ).Scan(¤tCourse.Selected) + if err != nil { + return fmt.Errorf("error querying course member number: %w", err) + } courses[currentCourse.ID] = ¤tCourse } - /* TODO: Populate currentCourse.Selected from the database */ - return nil } |