Management API: record routes for courses, meetings, class sessions, readings and deadlines (Fillable + Rules + TemporalErrors, PATCH, filters)
This commit is contained in:
@@ -162,25 +162,6 @@ func newManagedMaterialJSON(m models.Material) managedMaterialJSON {
|
||||
return out
|
||||
}
|
||||
|
||||
// ManagedCourses answers GET /courses: every course, for the course_id of
|
||||
// a material.
|
||||
func (h *Handlers) ManagedCourses(w http.ResponseWriter, r *http.Request) {
|
||||
db, ok := h.db(w, r)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
var rows []models.Course
|
||||
if err := db.Order("semester, sort_order, name, id").Find(&rows).Error; err != nil {
|
||||
writeOpaque500(w)
|
||||
return
|
||||
}
|
||||
out := make([]courseJSON, 0, len(rows))
|
||||
for _, c := range rows {
|
||||
out = append(out, newCourseJSON(c))
|
||||
}
|
||||
writeData(w, out)
|
||||
}
|
||||
|
||||
// ManagedMaterials answers GET /materials: every material, drafts
|
||||
// included, newest first.
|
||||
func (h *Handlers) ManagedMaterials(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user