Skip to content

Commit

Permalink
api/homework: homework/getForClass: show homework that's due on the s…
Browse files Browse the repository at this point in the history
…ame day in a consistent order
  • Loading branch information
thatoddmailbox committed Jun 13, 2024
1 parent 32464db commit eeaca3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/homework.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func routeHomeworkGetForClass(w http.ResponseWriter, r *http.Request, p httprout
}

// actually get the homework
rows, err := DB.Query("SELECT id, name, `due`, `desc`, `complete`, classId, userId FROM homework WHERE classId = ? AND userId = ? ORDER BY `due` ASC", classID, c.User.ID)
rows, err := DB.Query("SELECT id, name, `due`, `desc`, `complete`, classId, userId FROM homework WHERE classId = ? AND userId = ? ORDER BY `due` ASC, id ASC", classID, c.User.ID)
if err != nil {
errorlog.LogError("getting homework for class", err)
writeJSON(w, http.StatusInternalServerError, errorResponse{"error", "internal_server_error"})
Expand Down

0 comments on commit eeaca3f

Please sign in to comment.