Skip to content

Commit

Permalink
Check correct variable to get post caption (#1166)
Browse files Browse the repository at this point in the history
  • Loading branch information
radazen authored Aug 22, 2023
1 parent de5376c commit 8c2424a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion graphql/resolver/schema.resolvers.helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ func postsToConnection(ctx context.Context, posts []db.Post, contractID persist.
cval, _ := p.Caption.Value()

var caption *string
if caption != nil {
if cval != nil {
caption = util.ToPointer(cval.(string))
}

Expand Down
6 changes: 3 additions & 3 deletions publicapi/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ func (api ContractAPI) GetCommunityPostsByContractID(ctx context.Context, contra
}

results := make([]interface{}, len(posts))
for i, owner := range posts {
results[i] = owner
for i, post := range posts {
results[i] = post
}

return results, nil
Expand All @@ -314,7 +314,7 @@ func (api ContractAPI) GetCommunityPostsByContractID(ctx context.Context, contra
if user, ok := i.(db.Post); ok {
return user.CreatedAt, user.ID, nil
}
return time.Time{}, "", fmt.Errorf("interface{} is not a token")
return time.Time{}, "", fmt.Errorf("interface{} is not a post")
}

paginator := timeIDPaginator{
Expand Down

0 comments on commit 8c2424a

Please sign in to comment.