mirror of https://github.com/statping/statping
sort
parent
dc1607b998
commit
5799f53b6b
|
@ -113,6 +113,7 @@ func apiIncidentUpdatesHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
sendErrorJson(err, w, r)
|
sendErrorJson(err, w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
sortUpdates(incid.Updates)
|
||||||
returnJson(incid.Updates, w, r)
|
returnJson(incid.Updates, w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ func (i *Incident) BeforeCreate() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Incident) AfterFind() {
|
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")
|
metrics.Query("incident", "find")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue