Fix filtering deprecated tempalte params
This commit is contained in:
parent
6ef2e658e8
commit
712133ea44
1 changed files with 3 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
"github.com/evcc-io/evcc/util/templates"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
var supportedLanguages = []string{"en", "de"}
|
||||
|
|
@ -34,8 +35,8 @@ func templatesHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
// filter deprecated properties
|
||||
filterParams := func(t templates.Template) templates.Template {
|
||||
t.Params = slices.DeleteFunc(t.Params, func(p templates.Param) bool {
|
||||
return p.IsDeprecated()
|
||||
t.Params = lo.Filter(t.Params, func(p templates.Param, _ int) bool {
|
||||
return !p.IsDeprecated()
|
||||
})
|
||||
return t
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue