forked from jason/cpolis
Shorten lines by referencing frontend as f and backend as b
This commit is contained in:
@@ -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"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user