Fixed a bug that prevented {{.Action}} from being acessible in editor.html

This commit is contained in:
Jason Streifling 2024-10-04 11:50:51 +02:00
parent c00645432b
commit 533053aef0

View File

@ -38,10 +38,9 @@ func WriteArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc {
return return
} }
data := &EditorHTMLData{Action: "submit"} var data *EditorHTMLData
if session.Values["article"] == nil { if session.Values["article"] == nil {
data = &EditorHTMLData{Article: new(b.Article)} data = &EditorHTMLData{Action: "submit", Article: new(b.Article)}
} else { } else {
data = session.Values["article"].(*EditorHTMLData) data = session.Values["article"].(*EditorHTMLData)
} }