diff --git a/cmd/frontend/articles.go b/cmd/frontend/articles.go index 816480d..8819166 100644 --- a/cmd/frontend/articles.go +++ b/cmd/frontend/articles.go @@ -93,6 +93,10 @@ func SubmitArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc { http.Error(w, "Bitte den Titel eingeben.", http.StatusBadRequest) return } + if len(article.Summary) == 0 { + http.Error(w, "Bitte die Beschreibung eingeben.", http.StatusBadRequest) + return + } article.ID, err = db.AddArticle(article) if err != nil { @@ -179,6 +183,10 @@ func ResubmitArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc { } summary := r.PostFormValue("article-summary") + if len(summary) == 0 { + http.Error(w, "Bitte die Beschreibung eingeben.", http.StatusBadRequest) + return + } content := r.PostFormValue("article-content") if len(content) == 0 {