Just a whole bunch of fixing

This commit is contained in:
2018-07-09 21:41:17 +02:00
parent 5633460b97
commit 9c7b79403e
25 changed files with 208 additions and 320 deletions

View File

@@ -4,22 +4,23 @@ import (
"fmt"
"net/http"
"fornaxian.com/pixeldrain-web/pixelapi"
"github.com/Fornaxian/log"
"github.com/julienschmidt/httprouter"
)
// ServeListViewer controller for GET /l/:id
func (wc *WebController) serveListViewer(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
var list, aerr = wc.api.GetList(p.ByName("id"))
if aerr != nil {
if aerr.ReqError {
log.Error("API request error occurred: %s", aerr.Value)
var list, err = wc.api.GetList(p.ByName("id"))
if err != nil {
if (err.(pixelapi.Error)).ReqError {
log.Error("API request error occurred: %s", (err.(pixelapi.Error)).Value)
}
wc.serveNotFound(w, r)
return
}
var err error
var ogData OGData
listdata := map[string]interface{}{
"id": list.ID,