weldr: Return blueprint changes in descending timestamp order

This commit is contained in:
Brian C. Lane 2020-02-26 15:30:29 -08:00 committed by Tom Gundersen
parent cce9a2712c
commit 57f0892d93

View file

@ -1117,6 +1117,10 @@ func (api *API) blueprintsChangesHandler(writer http.ResponseWriter, request *ht
}
bpChanges := api.store.GetBlueprintChanges(name)
if bpChanges != nil {
// Sort the changes by Timestamp, descending
sort.Slice(bpChanges, func(i, j int) bool {
return bpChanges[i].Timestamp > bpChanges[j].Timestamp
})
change := change{
Changes: bpChanges,
Name: name,