pull/1113/head
akash-sachan 2023-05-11 19:42:52 +05:30
parent dc1607b998
commit 5799f53b6b
2 changed files with 2 additions and 1 deletions

View File

@ -113,6 +113,7 @@ func apiIncidentUpdatesHandler(w http.ResponseWriter, r *http.Request) {
sendErrorJson(err, w, r)
return
}
sortUpdates(incid.Updates)
returnJson(incid.Updates, w, r)
}

View File

@ -34,7 +34,7 @@ func (i *Incident) BeforeCreate() error {
}
func (i *Incident) AfterFind() {
db.Model(i).Related(i.Updates).Order("created_at DESC")
db.Model(i).Related(&i.Updates).Order("id DESC")
metrics.Query("incident", "find")
}