typos, gitignore for intelij
This commit is contained in:
parent
f9ab27e32a
commit
8f9969b4cc
|
@ -3,6 +3,8 @@ transmet
|
|||
db/dbconf.yml
|
||||
.Rhistory
|
||||
.project
|
||||
*.iml
|
||||
.idea
|
||||
*~
|
||||
*.o
|
||||
*.a
|
||||
|
|
|
@ -42,6 +42,11 @@ func (news *News) Insert(db *sql.DB) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func Delete(db *sql.DB, id int) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func nullStringToString(str *sql.NullString) string {
|
||||
if str.Valid {
|
||||
return str.String
|
||||
|
|
|
@ -242,16 +242,16 @@ func deleteHandler(w http.ResponseWriter, r *http.Request, user *user.User, sess
|
|||
if idErr != nil {
|
||||
session.AddFlash("Invalid news to delete", flash_err)
|
||||
} else {
|
||||
err := categories.Delete(db, id)
|
||||
err := news.Delete(db, id)
|
||||
if err != nil {
|
||||
session.AddFlash("Error commiting to Database", flash_err)
|
||||
} else {
|
||||
session.AddFlash("Deleted category", flash_info)
|
||||
session.AddFlash("Deleted news post", flash_info)
|
||||
}
|
||||
}
|
||||
|
||||
session.Save(r, w)
|
||||
http.Redirect(w, r, "/categories", http.StatusFound)
|
||||
http.Redirect(w, r, "/", http.StatusFound)
|
||||
}
|
||||
|
||||
|
||||
|
@ -381,7 +381,7 @@ func init_route_handlers() {
|
|||
r.HandleFunc("/export", userHandler(templateFormHandler))
|
||||
r.HandleFunc("/export-commit", userHandler(exportHandler))
|
||||
r.HandleFunc("/added", userHandler(addedHandler))
|
||||
r.handleFunc("/delete", userHandler(deleteHandler))
|
||||
r.HandleFunc("/delete", userHandler(deleteHandler))
|
||||
|
||||
r.HandleFunc("/categories", getPostHandler(userHandler(categoriesFormHandler), userHandler(categoriesPostHandler)))
|
||||
r.HandleFunc("/categories/change-parent", userHandler(categoryChangeParentHandler))
|
||||
|
|
Loading…
Reference in New Issue