summaryrefslogtreecommitdiff
path: root/internal/handlers
diff options
context:
space:
mode:
authorGrailFinder <wohilas@gmail.com>2024-04-04 12:40:44 +0300
committerGrailFinder <wohilas@gmail.com>2024-04-04 12:40:44 +0300
commitb662265234d70d648a7adce74f3d9cc245456d3a (patch)
tree64f707d16226bacf1c72a1a9c3836461722f6320 /internal/handlers
parent6fae7099dd2f2632aff9db3d6c04d8e66396f02d (diff)
Feat: action-done endpoint
Diffstat (limited to 'internal/handlers')
-rw-r--r--internal/handlers/main.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/handlers/main.go b/internal/handlers/main.go
index 38da212..dc8ba2b 100644
--- a/internal/handlers/main.go
+++ b/internal/handlers/main.go
@@ -94,3 +94,14 @@ func (h *Handlers) HandleForm(w http.ResponseWriter, r *http.Request) {
// tmpl.Execute(w, us)
tmpl.ExecuteTemplate(w, "main", us)
}
+
+func (h *Handlers) HandleDoneAction(w http.ResponseWriter, r *http.Request) {
+ r.ParseForm()
+ h.log.Info("got postform request", "payload", r.PostForm)
+ actionName := r.PostFormValue("name")
+ h.log.Info("got postform request", "name", actionName)
+ // change counter of user score
+ // get action by name
+ tmpl := template.Must(template.ParseGlob("components/*.html"))
+ tmpl.ExecuteTemplate(w, "main", nil)
+}