move-task.go (475B)
1 package handlers 2 3 import ( 4 "log/slog" 5 "net/http" 6 ) 7 8 func MoveTask(w http.ResponseWriter, r *http.Request) { 9 err := r.ParseForm() 10 if err != nil { 11 w.WriteHeader(http.StatusBadRequest) 12 return 13 } 14 15 id := r.PostForm.Get("id") 16 from := r.PostForm.Get("from") 17 to := r.PostForm.Get("to") 18 19 if id == "" || from == "" || to == "" { 20 w.WriteHeader(http.StatusBadRequest) 21 return 22 } 23 24 slog.Info("moved task", "id", id, "from", from, "to", to) 25 26 w.WriteHeader(http.StatusOK) 27 }