Shorten lines by referencing frontend as f and backend as b

This commit is contained in:
2024-07-13 14:09:11 +02:00
parent d0c1e525d2
commit 85e2f8b4ad
7 changed files with 105 additions and 107 deletions

View File

@@ -4,17 +4,17 @@ import (
"html/template"
"net/http"
"streifling.com/jason/cpolis/cmd/backend"
b "streifling.com/jason/cpolis/cmd/backend"
)
func CreateTag(c *backend.Config) http.HandlerFunc {
func CreateTag(c *b.Config) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
tmpl, err := template.ParseFiles(c.WebDir + "/templates/add-tag.html")
template.Must(tmpl, err).ExecuteTemplate(w, "page-content", nil)
}
}
func AddTag(c *backend.Config, db *backend.DB, s *backend.CookieStore) http.HandlerFunc {
func AddTag(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
db.AddTag(r.PostFormValue("tag"))