mirror of
https://github.com/rystaf/mlmym.git
synced 2024-11-09 16:55:17 +00:00
remove debug logs
This commit is contained in:
parent
46e1ba228a
commit
c1bdf44a73
|
@ -198,6 +198,7 @@ func Render(w http.ResponseWriter, templateName string, state State) {
|
||||||
tmpl, err := GetTemplate(templateName)
|
tmpl, err := GetTemplate(templateName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.Write([]byte("500 - Server Error"))
|
w.Write([]byte("500 - Server Error"))
|
||||||
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(state.TopCommunities) == 0 {
|
if len(state.TopCommunities) == 0 {
|
||||||
|
@ -485,7 +486,6 @@ func Settings(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
}
|
}
|
||||||
switch r.Method {
|
switch r.Method {
|
||||||
case "POST":
|
case "POST":
|
||||||
fmt.Println(r.FormValue("DefaultSortType"))
|
|
||||||
for _, name := range []string{"DefaultSortType", "DefaultListingType"} {
|
for _, name := range []string{"DefaultSortType", "DefaultListingType"} {
|
||||||
setCookie(w, state.Host, name, r.FormValue(name))
|
setCookie(w, state.Host, name, r.FormValue(name))
|
||||||
}
|
}
|
||||||
|
@ -500,7 +500,7 @@ func Settings(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
state.Sort = r.FormValue("DefaultSortType")
|
state.Sort = r.FormValue("DefaultSortType")
|
||||||
case "GET":
|
case "GET":
|
||||||
if state.Session != nil {
|
if state.Session != nil {
|
||||||
fmt.Println("get settings")
|
// TODO fetch server settings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Render(w, "settings.html", state)
|
Render(w, "settings.html", state)
|
||||||
|
@ -653,7 +653,6 @@ func UserOp(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
Render(w, "index.html", state)
|
Render(w, "index.html", state)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Println("user op ", r.FormValue("op"))
|
|
||||||
switch r.FormValue("op") {
|
switch r.FormValue("op") {
|
||||||
case "leave":
|
case "leave":
|
||||||
communityid, _ := strconv.Atoi(r.FormValue("communityid"))
|
communityid, _ := strconv.Atoi(r.FormValue("communityid"))
|
||||||
|
@ -668,7 +667,6 @@ func UserOp(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
Follow: true,
|
Follow: true,
|
||||||
})
|
})
|
||||||
case "logout":
|
case "logout":
|
||||||
fmt.Println("logout")
|
|
||||||
deleteCookie(w, state.Host, "jwt")
|
deleteCookie(w, state.Host, "jwt")
|
||||||
deleteCookie(w, state.Host, "user")
|
deleteCookie(w, state.Host, "user")
|
||||||
case "login":
|
case "login":
|
||||||
|
@ -838,7 +836,6 @@ func UserOp(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
}
|
}
|
||||||
case "delete_post":
|
case "delete_post":
|
||||||
postid, _ := strconv.Atoi(r.FormValue("postid"))
|
postid, _ := strconv.Atoi(r.FormValue("postid"))
|
||||||
fmt.Println("delete " + r.FormValue("postid"))
|
|
||||||
post := types.DeletePost{
|
post := types.DeletePost{
|
||||||
PostID: postid,
|
PostID: postid,
|
||||||
Deleted: true,
|
Deleted: true,
|
||||||
|
|
1
state.go
1
state.go
|
@ -537,7 +537,6 @@ func (state *State) GetCommunity(communityName string) {
|
||||||
if state.CommunityName == "" {
|
if state.CommunityName == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Println("Get community " + state.CommunityName)
|
|
||||||
resp, err := state.Client.Community(context.Background(), types.GetCommunity{
|
resp, err := state.Client.Community(context.Background(), types.GetCommunity{
|
||||||
Name: types.NewOptional(state.CommunityName),
|
Name: types.NewOptional(state.CommunityName),
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue