Commit 76731eb3 authored by raju249's avatar raju249

Add status 422 in case of errors only

parent 1d7bcbf3
...@@ -63,7 +63,11 @@ module NotesActions ...@@ -63,7 +63,11 @@ module NotesActions
json.merge!(note_json(@note)) json.merge!(note_json(@note))
end end
render json: json if notes.errors && notes.errors.keys != [:commands_only]
render json: json, status: 422
else
render json: json
end
end end
format.html { redirect_back_or_default } format.html { redirect_back_or_default }
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment