bin/controllers/partials.go

24 lines
635 B
Go

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())
}
func GetPartialEmailForm(c echo.Context) error {
return utils.RenderComponents(c, http.StatusOK, partials.EmailForm())
}