1
0
Fork 0

Add missing return in fetchContent ui handler

This commit is contained in:
Frédéric Guillot 2023-09-06 20:34:36 -07:00
parent 69738bce84
commit 5ce912beea

View file

@ -34,12 +34,10 @@ func (h *handler) fetchContent(w http.ResponseWriter, r *http.Request) {
return return
} }
user, err := h.store.UserByID(entry.UserID) user, err := h.store.UserByID(loggedUserID)
if err != nil { if err != nil {
json.ServerError(w, r, err) json.ServerError(w, r, err)
} return
if user == nil {
json.NotFound(w, r)
} }
feedBuilder := storage.NewFeedQueryBuilder(h.store, loggedUserID) feedBuilder := storage.NewFeedQueryBuilder(h.store, loggedUserID)
@ -62,6 +60,7 @@ func (h *handler) fetchContent(w http.ResponseWriter, r *http.Request) {
if err := h.store.UpdateEntryContent(entry); err != nil { if err := h.store.UpdateEntryContent(entry); err != nil {
json.ServerError(w, r, err) json.ServerError(w, r, err)
return
} }
readingTime := locale.NewPrinter(user.Language).Plural("entry.estimated_reading_time", entry.ReadingTime, entry.ReadingTime) readingTime := locale.NewPrinter(user.Language).Plural("entry.estimated_reading_time", entry.ReadingTime, entry.ReadingTime)