diff --git a/cmd/frontend/articles.go b/cmd/frontend/articles.go index f376399..dd1335b 100644 --- a/cmd/frontend/articles.go +++ b/cmd/frontend/articles.go @@ -38,10 +38,9 @@ func WriteArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc { return } - data := &EditorHTMLData{Action: "submit"} - + var data *EditorHTMLData if session.Values["article"] == nil { - data = &EditorHTMLData{Article: new(b.Article)} + data = &EditorHTMLData{Action: "submit", Article: new(b.Article)} } else { data = session.Values["article"].(*EditorHTMLData) }