Redmage/server/routes/page_subreddits_add.go

26 lines
622 B
Go
Raw Permalink Normal View History

package routes
import (
"net/http"
"github.com/tigorlazuardi/redmage/pkg/log"
"github.com/tigorlazuardi/redmage/views"
2024-05-27 21:10:37 +07:00
"github.com/tigorlazuardi/redmage/views/subreddits/put"
)
func (routes *Routes) PageSubredditsAdd(rw http.ResponseWriter, r *http.Request) {
ctx, span := tracer.Start(r.Context(), "Routes.PageSubredditsAdd")
defer span.End()
c := views.NewContext(routes.Config, r)
data := put.Data{
Title: "Add Subreddit",
PostAction: "/htmx/subreddits/add",
}
2024-05-27 21:10:37 +07:00
if err := put.View(c, data).Render(ctx, rw); err != nil {
log.New(ctx).Err(err).Error("failed to render subreddits add page")
}
}