app/controllers/phcpresspro/api/v1/posts_controller.rb in phcpresspro-21.1.0 vs app/controllers/phcpresspro/api/v1/posts_controller.rb in phcpresspro-22.0.0
- old
+ new
@@ -6,15 +6,15 @@
# Only Responds to API Requests
respond_to :json
# Article Category API
def index
- @article_posts = Article::Post.order('psttitle ASC')
+ @article_posts = Article::Post.where(poststatus: published).order('created_at ASC')
end
# Article Show
def show
- @article_post = Article::Post.find(params[:id])
+ @article_post = Article::Post.where(poststatus: published).find(params[:id])
end
end
end