From aeead5e378a0573181f0e5c2e8c7354faf27c7cb Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 23 May 2023 02:47:29 +0400 Subject: [PATCH] New, Edit, and Delete was renamed to *Post. --- internal/http/api_handlers.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/http/api_handlers.go b/internal/http/api_handlers.go index ef93634..e5a26db 100644 --- a/internal/http/api_handlers.go +++ b/internal/http/api_handlers.go @@ -220,7 +220,7 @@ func NewMindflowApiHandlers(db mindflow.Mindflow) *MindflowApiHandlers { 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 err error @@ -252,7 +252,7 @@ func (h *MindflowApiHandlers) New(w http.ResponseWriter, r *http.Request) { 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 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) if err := h.db.DeletePost(id); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError)