From d4c19ec4ff6b4d75a5f60fb224aa07fdc533d45e Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 9 Feb 2025 11:28:19 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Add=20missing=20information=20to?= =?UTF-8?q?=20response?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/api/response/init.go | 36 +++++++++++++++++------------- internal/api/response/init_test.go | 20 ++++++++++------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/internal/api/response/init.go b/internal/api/response/init.go index 5815367..753cf68 100644 --- a/internal/api/response/init.go +++ b/internal/api/response/init.go @@ -15,14 +15,16 @@ type InitTicker struct { } type InitTickerInformation struct { - Author string `json:"author"` - URL string `json:"url"` - Email string `json:"email"` - Twitter string `json:"twitter"` - Facebook string `json:"facebook"` - Telegram string `json:"telegram"` - Mastodon string `json:"mastodon"` - Bluesky string `json:"bluesky"` + Author string `json:"author"` + URL string `json:"url"` + Email string `json:"email"` + Twitter string `json:"twitter"` + Facebook string `json:"facebook"` + Instagram string `json:"instagram"` + Threads string `json:"threads"` + Telegram string `json:"telegram"` + Mastodon string `json:"mastodon"` + Bluesky string `json:"bluesky"` } func InitTickerResponse(ticker storage.Ticker) InitTicker { @@ -32,14 +34,16 @@ func InitTickerResponse(ticker storage.Ticker) InitTicker { Title: ticker.Title, Description: ticker.Description, Information: InitTickerInformation{ - Author: ticker.Information.Author, - URL: ticker.Information.URL, - Email: ticker.Information.Email, - Twitter: ticker.Information.Twitter, - Facebook: ticker.Information.Facebook, - Telegram: ticker.Information.Telegram, - Mastodon: ticker.Information.Mastodon, - Bluesky: ticker.Information.Bluesky, + Author: ticker.Information.Author, + URL: ticker.Information.URL, + Email: ticker.Information.Email, + Twitter: ticker.Information.Twitter, + Facebook: ticker.Information.Facebook, + Instagram: ticker.Information.Instagram, + Threads: ticker.Information.Threads, + Telegram: ticker.Information.Telegram, + Mastodon: ticker.Information.Mastodon, + Bluesky: ticker.Information.Bluesky, }, } } diff --git a/internal/api/response/init_test.go b/internal/api/response/init_test.go index 1fe78fe..1181aa5 100644 --- a/internal/api/response/init_test.go +++ b/internal/api/response/init_test.go @@ -20,14 +20,16 @@ func (s *InitTickerResponseTestSuite) TestInitTickerResponse() { Title: "Example", Description: "Example", Information: storage.TickerInformation{ - Author: "Example", - URL: "https://example.com", - Email: "contact@example.com", - Twitter: "example", - Facebook: "example", - Telegram: "example", - Mastodon: "example", - Bluesky: "example", + Author: "Example", + URL: "https://example.com", + Email: "contact@example.com", + Twitter: "example", + Facebook: "example", + Instagram: "example", + Threads: "example", + Telegram: "example", + Mastodon: "example", + Bluesky: "example", }, } @@ -42,6 +44,8 @@ func (s *InitTickerResponseTestSuite) TestInitTickerResponse() { s.Equal(ticker.Information.Email, response.Information.Email) s.Equal(ticker.Information.Twitter, response.Information.Twitter) s.Equal(ticker.Information.Facebook, response.Information.Facebook) + s.Equal(ticker.Information.Instagram, response.Information.Instagram) + s.Equal(ticker.Information.Threads, response.Information.Threads) s.Equal(ticker.Information.Telegram, response.Information.Telegram) s.Equal(ticker.Information.Mastodon, response.Information.Mastodon) s.Equal(ticker.Information.Bluesky, response.Information.Bluesky)