1
0

Fixed misplaced if err != nil {} in mindflow page handlers.

This commit is contained in:
Alexander Andreev 2023-05-20 06:28:23 +04:00
parent 76830d4468
commit 2938f26f3a
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -53,24 +53,24 @@ func (h *Handlers) Stuff(w http.ResponseWriter, r *http.Request) {
func (h *Handlers) Mindflow(w http.ResponseWriter, r *http.Request) {
posts, err := h.mindflowDB.GetAll()
for _, entry := range posts {
entry.Body = strings.ReplaceAll(entry.Body, "\\n", "\n")
}
if err != nil {
return
}
for _, entry := range posts {
entry.Body = strings.ReplaceAll(entry.Body, "\\n", "\n")
}
web.Mindflow("/ Mindflow", posts, r, w)
}
func (h *Handlers) MindflowAdmin(w http.ResponseWriter, r *http.Request) {
posts, err := h.mindflowDB.GetAll()
for _, entry := range posts {
entry.Body = strings.ReplaceAll(entry.Body, "\\n", "\n")
}
if err != nil {
return
}
for _, entry := range posts {
entry.Body = strings.ReplaceAll(entry.Body, "\\n", "\n")
}
web.MindflowAdmin("/ Mindflow Administration", posts, r, w)
}