Skip to content

Commit

Permalink
Add missing return in fetchContent ui handler
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Sep 7, 2023
1 parent 69738bc commit 4a4d77b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/ui/entry_scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ func (h *handler) fetchContent(w http.ResponseWriter, r *http.Request) {
return
}

user, err := h.store.UserByID(entry.UserID)
user, err := h.store.UserByID(loggedUserID)
if err != nil {
json.ServerError(w, r, err)
}
if user == nil {
json.NotFound(w, r)
return
}

feedBuilder := storage.NewFeedQueryBuilder(h.store, loggedUserID)
Expand All @@ -62,6 +60,7 @@ func (h *handler) fetchContent(w http.ResponseWriter, r *http.Request) {

if err := h.store.UpdateEntryContent(entry); err != nil {
json.ServerError(w, r, err)
return
}

readingTime := locale.NewPrinter(user.Language).Plural("entry.estimated_reading_time", entry.ReadingTime, entry.ReadingTime)
Expand Down

0 comments on commit 4a4d77b

Please sign in to comment.