0
0
mirror of https://github.com/rls-moe/nyx synced 2025-08-19 06:18:38 +00:00

Images/Non-images post work, several bug fixes, UI fixes

This commit is contained in:
Tim Schuster
2017-03-13 18:45:23 +01:00
parent 4177901714
commit afd9ae71cf
21 changed files with 2206 additions and 23 deletions

21
http/admin/cleanup.go Normal file
View File

@@ -0,0 +1,21 @@
package admin
import (
"github.com/tidwall/buntdb"
"go.rls.moe/nyx/http/errw"
"go.rls.moe/nyx/http/middle"
"net/http"
)
func handleCleanup(w http.ResponseWriter, r *http.Request) {
db := middle.GetDB(r)
err := db.Update(func(tx *buntdb.Tx) error {
/* Insert cleanup codes here */
return nil
})
err = db.Shrink()
if err != nil {
errw.ErrorWriter(err, w, r)
return
}
}

View File

@@ -106,6 +106,8 @@ func handleDelPost(w http.ResponseWriter, r *http.Request) {
}
reply.Text = "[deleted]"
reply.Metadata["deleted"] = "yes"
reply.Image = nil
reply.Thumbnail = nil
err = resources.UpdateReply(tx, r.Host, board, reply)
if err != nil {
return err