remove user comment pagination

?
This commit is contained in:
orangix
2023-08-15 20:59:37 +02:00
parent 8bb1ab0810
commit b8329145f1
3 changed files with 4 additions and 25 deletions

View File

@@ -102,8 +102,8 @@ func (client *Client) FetchSubmissions(username string, sort string, page string
return submissions, nil
}
func (client *Client) FetchUserComments(username string, page string) ([]Comment, error) {
cacheData, found := client.Cache.Get(username + "-usercomments-" + page)
func (client *Client) FetchUserComments(username string) ([]Comment, error) {
cacheData, found := client.Cache.Get(username + "-usercomments")
if found {
return cacheData.([]Comment), nil
}
@@ -150,7 +150,7 @@ func (client *Client) FetchUserComments(username string, page string) ([]Comment
)
wg.Wait()
client.Cache.Set(username+"-usercomments-"+page, comments, cache.DefaultExpiration)
client.Cache.Set(username+"-usercomments", comments, cache.DefaultExpiration)
return comments, nil
}