From af592c446f347aadbd0f1a3493dfc80d697b3699 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Thu, 19 May 2022 12:43:37 -0400 Subject: [PATCH] Fix watcher list endpoint --- internal/api/watcher.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/api/watcher.go b/internal/api/watcher.go index 69f2f40..e843871 100644 --- a/internal/api/watcher.go +++ b/internal/api/watcher.go @@ -240,7 +240,7 @@ type watcherItem struct { Type string `json:"type"` Label string `json:"label"` SourceLabel string `json:"source_label"` - Upvotes *int64 `json:"upvotes,omitempty"` + Upvotes int64 `json:"upvotes,omitempty"` Keyword string `json:"keyword,omitempty"` Flair string `json:"flair,omitempty"` Domain string `json:"domain,omitempty"` @@ -274,10 +274,7 @@ func (a *api) listWatchersHandler(w http.ResponseWriter, r *http.Request) { Domain: watcher.Domain, Hits: watcher.Hits, Author: watcher.Author, - } - - if watcher.Upvotes != 0 { - wi.Upvotes = &watcher.Upvotes + Upvotes: watcher.Upvotes, } wis[i] = wi