refactor: rebuild application with stl only

This commit is contained in:
Patryk Hegenberg 2024-11-27 16:49:27 +01:00
parent 0a4efb8630
commit da24e3c258
10 changed files with 36 additions and 56 deletions

View file

@ -2,14 +2,12 @@ package controllers
import (
"net/http"
"github.com/labstack/echo/v4"
)
func (c *Controller) AddBewertungRoute(ctx echo.Context) error {
new := c.ParseBewertungen(ctx)
func (c *Controller) AddBewertungRoute(w http.ResponseWriter, r *http.Request) {
new := c.ParseBewertungen(w, r)
if new.Nachname != "" {
*c.Bewertungen = append(*c.Bewertungen, new)
}
return ctx.Redirect(http.StatusSeeOther, "/")
http.Redirect(w, r, "/", http.StatusSeeOther)
}