From ba8581960724242e010746ee3d1c50fec75c7ab2 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 3 Nov 2021 13:59:21 -0400 Subject: [PATCH] Add PostCount property to Category --- category/category.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/category/category.go b/category/category.go index bc427b1..4ac81c3 100644 --- a/category/category.go +++ b/category/category.go @@ -12,10 +12,11 @@ var ( // Category represents a post tag with additional metadata, like a title and slug. type Category struct { - ID int64 `json:"-"` - Hashtag string `json:"hashtag"` - Slug string `json:"slug"` - Title string `json:"title"` + ID int64 `json:"-"` + Hashtag string `json:"hashtag"` + Slug string `json:"slug"` + Title string `json:"title"` + PostCount int64 `json:"post_count"` } // NewCategory creates a Category you can insert into the database, based on a hashtag. It automatically breaks up the