mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Ask for confirmation before flushing history
This commit is contained in:
parent
99149d9f2a
commit
ac3693562b
4 changed files with 19 additions and 8 deletions
|
@ -8,16 +8,15 @@ import (
|
|||
"net/http"
|
||||
|
||||
"miniflux.app/http/request"
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/http/route"
|
||||
"miniflux.app/http/response/json"
|
||||
)
|
||||
|
||||
func (h *handler) flushHistory(w http.ResponseWriter, r *http.Request) {
|
||||
err := h.store.FlushHistory(request.UserID(r))
|
||||
if err != nil {
|
||||
html.ServerError(w, r, err)
|
||||
json.ServerError(w, r, err)
|
||||
return
|
||||
}
|
||||
|
||||
html.Redirect(w, r, route.Path(h.router, "history"))
|
||||
json.OK(w, r, "OK")
|
||||
}
|
||||
|
|
2
ui/ui.go
2
ui/ui.go
|
@ -45,7 +45,7 @@ func Serve(router *mux.Router, store *storage.Storage, pool *worker.Pool, feedHa
|
|||
// History pages.
|
||||
uiRouter.HandleFunc("/history", handler.showHistoryPage).Name("history").Methods("GET")
|
||||
uiRouter.HandleFunc("/history/entry/{entryID}", handler.showReadEntryPage).Name("readEntry").Methods("GET")
|
||||
uiRouter.HandleFunc("/history/flush", handler.flushHistory).Name("flushHistory").Methods("GET")
|
||||
uiRouter.HandleFunc("/history/flush", handler.flushHistory).Name("flushHistory").Methods("POST")
|
||||
|
||||
// Bookmark pages.
|
||||
uiRouter.HandleFunc("/starred", handler.showStarredPage).Name("starred").Methods("GET")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue