1
0

New, Edit, and Delete was renamed to *Post.

This commit is contained in:
Alexander Andreev 2023-05-23 02:47:29 +04:00
parent 561425b739
commit aeead5e378
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -220,7 +220,7 @@ func NewMindflowApiHandlers(db mindflow.Mindflow) *MindflowApiHandlers {
return &MindflowApiHandlers{db: db} return &MindflowApiHandlers{db: db}
} }
func (h *MindflowApiHandlers) New(w http.ResponseWriter, r *http.Request) { func (h *MindflowApiHandlers) NewPost(w http.ResponseWriter, r *http.Request) {
var post *mindflow.Post var post *mindflow.Post
var err error var err error
@ -252,7 +252,7 @@ func (h *MindflowApiHandlers) New(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/mindflow/admin", http.StatusMovedPermanently) http.Redirect(w, r, "/mindflow/admin", http.StatusMovedPermanently)
} }
func (h *MindflowApiHandlers) Edit(w http.ResponseWriter, r *http.Request) { func (h *MindflowApiHandlers) EditPost(w http.ResponseWriter, r *http.Request) {
var post *mindflow.Post var post *mindflow.Post
var err error var err error
@ -294,7 +294,7 @@ func (h *MindflowApiHandlers) Edit(w http.ResponseWriter, r *http.Request) {
} }
} }
func (h *MindflowApiHandlers) Delete(w http.ResponseWriter, r *http.Request) { func (h *MindflowApiHandlers) DeletePost(w http.ResponseWriter, r *http.Request) {
id, _ := strconv.ParseInt(GetURLParam(r, "id"), 10, 64) id, _ := strconv.ParseInt(GetURLParam(r, "id"), 10, 64)
if err := h.db.DeletePost(id); err != nil { if err := h.db.DeletePost(id); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError) http.Error(w, err.Error(), http.StatusInternalServerError)