You've already forked nyx
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:
21
http/admin/cleanup.go
Normal file
21
http/admin/cleanup.go
Normal 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
|
||||
}
|
||||
}
|
@@ -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
|
||||
|
Reference in New Issue
Block a user