Add notes to blocks (#193)

In this commit, we also push note creation into the AccountInteractions
concern, where we can:

1. create and persist model objects inside transactions without having
   to include job queuing inside the transaction
2. commonize the don't-add-a-blank-note check

Finally, this commit resolves a invocation-on-nil in
REST::RelationshipSerializer.
This commit is contained in:
David Yip
2018-01-26 04:03:02 -06:00
parent 1704e0066a
commit 5e6a09498a
6 changed files with 51 additions and 18 deletions

View File

@@ -21,7 +21,7 @@ class Api::V1::AccountsController < Api::BaseController
end
def block
BlockService.new.call(current_user.account, @account)
BlockService.new.call(current_user.account, @account, note: params[:note])
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships
end