sort slice before return

This commit is contained in:
Hayden 2024-01-05 11:33:20 -06:00
parent 645155ad10
commit 2240617c8e
No known key found for this signature in database
GPG key ID: 17CF79474E257545
3 changed files with 202 additions and 3 deletions

View file

@ -136,6 +136,9 @@ func (ctrl *V1Controller) HandleBase(ready ReadyFunc, build Build) errchain.Hand
// @Router /v1/currency [GET]
func (ctrl *V1Controller) HandleCurrency() errchain.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) error {
// Set Cache for 10 Minutes
w.Header().Set("Cache-Control", "max-age=600")
return server.JSON(w, http.StatusOK, ctrl.svc.Currencies.Slice())
}
}