1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-06 17:41:00 +00:00

Move UI middlewares and routes to ui package

This commit is contained in:
Frédéric Guillot 2018-11-11 11:28:29 -08:00
parent 0925899cee
commit 5a69a61d48
70 changed files with 739 additions and 769 deletions

View file

@ -13,10 +13,9 @@ import (
"miniflux.app/model"
)
// SaveEntry send the link to external services.
func (c *Controller) SaveEntry(w http.ResponseWriter, r *http.Request) {
func (h *handler) saveEntry(w http.ResponseWriter, r *http.Request) {
entryID := request.RouteInt64Param(r, "entryID")
builder := c.store.NewEntryQueryBuilder(request.UserID(r))
builder := h.store.NewEntryQueryBuilder(request.UserID(r))
builder.WithEntryID(entryID)
builder.WithoutStatus(model.EntryStatusRemoved)
@ -31,14 +30,14 @@ func (c *Controller) SaveEntry(w http.ResponseWriter, r *http.Request) {
return
}
settings, err := c.store.Integration(request.UserID(r))
settings, err := h.store.Integration(request.UserID(r))
if err != nil {
json.ServerError(w, r, err)
return
}
go func() {
integration.SendEntry(c.cfg, entry, settings)
integration.SendEntry(h.cfg, entry, settings)
}()
json.Created(w, r, map[string]string{"message": "saved"})