fixed reference to PathParams
This commit is contained in:
@@ -74,14 +74,15 @@ func Router(
|
|||||||
r.Group("/ui"),
|
r.Group("/ui"),
|
||||||
contentDir,
|
contentDir,
|
||||||
// TODO: move this constructor call up to main.go
|
// TODO: move this constructor call up to main.go
|
||||||
|
// TODO: clean up the references to the templates dir throughout as well (should only be referred to in the 'main' package
|
||||||
new(templater.Templater).With(templater.Config{
|
new(templater.Templater).With(templater.Config{
|
||||||
Funcs: func(name string, props map[string]any) template.FuncMap {
|
Funcs: func(name string, props map[string]any) template.FuncMap {
|
||||||
return template.FuncMap{
|
return template.FuncMap{
|
||||||
// params
|
// params
|
||||||
"addPathParam": func(k string, v any, args map[string]any) (map[string]any, error) {
|
"addPathParam": func(k string, v any, args map[string]any) (map[string]any, error) {
|
||||||
pathParams, ok := args["PathParams"].(map[string]string)
|
pathParams, ok := args["PathParams"].(map[string]any)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("PathParams no set are args: %v", args)
|
return nil, fmt.Errorf("PathParams not set as args: %v", args)
|
||||||
}
|
}
|
||||||
|
|
||||||
pathParams[k] = fmt.Sprint(v)
|
pathParams[k] = fmt.Sprint(v)
|
||||||
|
|||||||
Reference in New Issue
Block a user