bin/controllers/partials.go

24 lines
635 B
Go
Raw Permalink Normal View History

2023-09-11 23:26:50 +02:00
package controllers
import (
"net/http"
"git.myrkvi.com/myrkvi/bin/utils"
"git.myrkvi.com/myrkvi/bin/views/partials"
"github.com/labstack/echo/v4"
)
func GetPartialUploadHandler(c echo.Context) error {
c.Response().Header().Add("HX-Push", "/new")
return utils.RenderComponents(c, http.StatusOK, partials.NewFileUpload())
}
func GetPartialTextHandler(c echo.Context) error {
c.Response().Header().Add("HX-Push", "/new?text")
return utils.RenderComponents(c, http.StatusOK, partials.NewTextSubmit())
}
2023-09-12 22:30:58 +02:00
func GetPartialEmailForm(c echo.Context) error {
return utils.RenderComponents(c, http.StatusOK, partials.EmailForm())
}