Add a writing role to the shortcuts controller

This commit is contained in:
Fosco Marotto 2021-02-18 16:57:34 -05:00
parent be5fc25544
commit fea1b9389b
1 changed files with 5 additions and 3 deletions

View File

@ -29,7 +29,9 @@ class Api::V1::ShortcutsController < Api::BaseController
elsif s.shortcut_type == 'account'
@account = @accounts.detect{ |a| a.id == s.shortcut_id }
if @account.nil?
ActiveRecord::Base.connected_to(role: :writing) do
s.destroy!
end
else
value = REST::AccountSerializer.new(@account)
end