Skip to content

Commit

Permalink
Merge pull request #806 from factly/fix/805/dega-api/post-status
Browse files Browse the repository at this point in the history
dega api : append posts with status publish only for entities
  • Loading branch information
shreeharsha-factly authored Nov 8, 2022
2 parents a331be7 + e4ec2ed commit a856936
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions api/graph/resolvers/category.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ func (r *categoryResolver) Posts(ctx context.Context, obj *models.Category) (*mo
if err != nil {
return nil, err
}

posts = append(posts, post)
if post.Status == "publish" {
posts = append(posts, post)
}
}
response := new(models.PostsPaging)
response.Nodes = posts
Expand Down
4 changes: 3 additions & 1 deletion api/graph/resolvers/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ func (r *tagResolver) Posts(ctx context.Context, obj *models.Tag) (*models.Posts
return nil, err
}

posts = append(posts, post)
if post.Status == "publish" {
posts = append(posts, post)
}
}
response := new(models.PostsPaging)
response.Nodes = posts
Expand Down

0 comments on commit a856936

Please sign in to comment.