type-fix-7
This commit is contained in:
parent
f244330401
commit
29026ed6fb
|
@ -242,23 +242,22 @@ func (c *provider) GetUserAppDataFromRedis(userId string) (string, error) {
|
|||
combinedData := "{"
|
||||
|
||||
// Use authorProfileMap["id"] here if necessary
|
||||
authorId, err := int(authorProfileMap["id"].(float64)) // convert float64 to int
|
||||
if err != nil {
|
||||
authorId := int(authorProfileMap["id"].(float64)) // convert float64 to int
|
||||
if authorId != nil {
|
||||
combinedData += fmt.Sprintf(`"profile": %s`, authorProfileString)
|
||||
}
|
||||
|
||||
authorFollowsAuthorsString, err := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:follows-authors`, authorId))
|
||||
if err != nil {
|
||||
authorFollowsAuthorsString := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:follows-authors`, authorId))
|
||||
if authorFollowsAuthorsString != nil {
|
||||
combinedData += fmt.Sprintf(`,"authors": %s`, authorFollowsAuthorsString)
|
||||
}
|
||||
|
||||
authorFollowsTopicsString, err := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:follows-topics`, authorId))
|
||||
if err != nil {
|
||||
authorFollowsTopicsString := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:follows-topics`, authorId))
|
||||
if authorFollowsTopicsString != nil {
|
||||
combinedData += fmt.Sprintf(`,"topics": %s`, authorFollowsTopicsString)
|
||||
}
|
||||
|
||||
authorFollowers, err := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:followers`, authorId))
|
||||
if err != nil {
|
||||
authorFollowers := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:followers`, authorId))
|
||||
if authorFollowers != nil {
|
||||
combinedData += fmt.Sprintf(`,"followers": %s`, authorFollowers)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user