fix authenticated client call

This commit is contained in:
Andre Medeiros 2022-06-25 15:52:47 -04:00
parent 51ba167a09
commit ad62000372

View file

@ -195,8 +195,7 @@ func (sc *subredditsConsumer) Consume(delivery rmq.Delivery) {
i := rand.Intn(len(watchers))
watcher := watchers[i]
acc, _ := sc.accountRepo.GetByID(sc, watcher.AccountID)
rac := sc.reddit.NewAuthenticatedClient(acc.AccountID, acc.RefreshToken, acc.AccessToken)
rac := sc.reddit.NewAuthenticatedClient(watcher.Account.AccountID, watcher.Account.RefreshToken, watcher.Account.AccessToken)
sps, err := rac.SubredditNew(sc,
subreddit.Name,
reddit.WithQuery("before", before),