From eeaca3f80a885c019fe16ab71bd6fa5e707967e1 Mon Sep 17 00:00:00 2001 From: Alex Studer Date: Thu, 13 Jun 2024 17:15:32 -0400 Subject: [PATCH] api/homework: homework/getForClass: show homework that's due on the same day in a consistent order --- api/homework.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/homework.go b/api/homework.go index c0f2d66..5d3750b 100644 --- a/api/homework.go +++ b/api/homework.go @@ -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"})