General improvements to postlist and post

This commit is contained in:
riggraz
2019-09-21 11:17:58 +02:00
parent 38345f9c42
commit 7874015580
11 changed files with 25 additions and 13 deletions

View File

@@ -15,7 +15,8 @@ class CommentsController < ApplicationController
comment = Comment.new(comment_params)
if comment.save
render json: comment, status: :created
render json: comment.attributes.merge({ user_full_name: current_user.full_name}),
status: :created
else
render json: {
error: I18n.t('errors.comment.create', message: comment.errors.full_messages)