aboutsummaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'http.go')
-rw-r--r--http.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/http.go b/http.go
index bdac799..b6cfed2 100644
--- a/http.go
+++ b/http.go
@@ -67,7 +67,7 @@ func (papers *Papers) IndexHandler(w http.ResponseWriter, r *http.Request) {
http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
return
}
- res := Resp{Papers: *papers}
+ res := Resp{Papers: papers}
err := indexTemp.Execute(w, &res)
if err != nil {
fmt.Println(err)
@@ -78,7 +78,7 @@ func (papers *Papers) IndexHandler(w http.ResponseWriter, r *http.Request) {
// additional forms to modify the collection (add, delete, rename...)
func (papers *Papers) AdminHandler(w http.ResponseWriter, r *http.Request) {
- res := Resp{Papers: *papers}
+ res := Resp{Papers: papers}
if user != "" && pass != "" {
username, password, ok := r.BasicAuth()
if ok && user == username && pass == password {
@@ -98,7 +98,7 @@ func (papers *Papers) AdminHandler(w http.ResponseWriter, r *http.Request) {
// a checkbox to each unique paper and category for modification
func (papers *Papers) EditHandler(w http.ResponseWriter, r *http.Request) {
- res := Resp{Papers: *papers}
+ res := Resp{Papers: papers}
if user != "" && pass != "" {
username, password, ok := r.BasicAuth()
if !ok || user != username || pass != password {
@@ -228,7 +228,7 @@ func (papers *Papers) AddHandler(w http.ResponseWriter, r *http.Request) {
res.Status = fmt.Sprintf("category %q added successfully", nc)
}
}
- res.Papers = *papers
+ res.Papers = papers
adminTemp.Execute(w, &res)
}