Return new transaction on create
This commit is contained in:
parent
54b8e8808b
commit
6c04a90f68
1 changed files with 3 additions and 2 deletions
|
@ -3,6 +3,7 @@ class TransactionsController < ApplicationController
|
|||
|
||||
before_action :authenticate_user!, except: :create
|
||||
before_action :authenticate_user_or_client!, only: :create
|
||||
|
||||
respond_to :js, only: :create
|
||||
|
||||
def create
|
||||
|
@ -11,7 +12,7 @@ class TransactionsController < ApplicationController
|
|||
authorize!(:create, @transaction)
|
||||
|
||||
if @transaction.save
|
||||
head :created
|
||||
render json: @transaction, status: :created
|
||||
else
|
||||
render json: @transaction.errors.full_messages,
|
||||
status: :unprocessable_entity
|
||||
|
|
Loading…
Reference in a new issue