Fix reference to mock file templates
This commit is contained in:
parent
bacd452346
commit
ff86a5488e
2 changed files with 2 additions and 2 deletions
|
|
@ -76,7 +76,7 @@ func NewBuiltTemplate(embeddedFiles embed.FS, subdir string, files ...string) *B
|
||||||
template: parseEmbedded(embeddedFiles, subdir, files),
|
template: parseEmbedded(embeddedFiles, subdir, files),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TemplatesByFilename[files[0]] = result
|
TemplatesByFilename[path.Base(files[0])] = result
|
||||||
return &result
|
return &result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -239,7 +239,7 @@ func Mock(t string, w http.ResponseWriter, code string) {
|
||||||
SettingUserAdd: "/mock/setting/user/add",
|
SettingUserAdd: "/mock/setting/user/add",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
template, ok := htmlpage.TemplatesByFilename[t]
|
template, ok := htmlpage.TemplatesByFilename[t+".html"]
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Error().Str("template", t).Msg("Failed to find template")
|
log.Error().Str("template", t).Msg("Failed to find template")
|
||||||
respondError(w, "Failed to render template", nil, http.StatusInternalServerError)
|
respondError(w, "Failed to render template", nil, http.StatusInternalServerError)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue