Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cherelemma committed Jul 15, 2023
1 parent 327e4e7 commit 8bfb819
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create
post = Post.find(params[:post_id])
comment = post.comments.build(comment_params)
comment.user = current_user

if comment.save
render json: comment, status: :created
else
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/posts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Api::PostsController < ApplicationController
def index
user = User.find(params[:user_id])
posts = user.posts

if posts.present?
render json: { message: 'Posts loaded successfully', data: posts }, status: :ok
else
Expand Down

0 comments on commit 8bfb819

Please sign in to comment.