Class: Ishapi::EmailConversationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ishapi/email_conversations_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#exception, #home, #long_term_token, #vote

Instance Method Details

#deleteObject



22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/ishapi/email_conversations_controller.rb', line 22

def delete
  authorize! :email_conversations_delete, ::Ishapi
  convos = Office::EmailConversation.find params[:ids]
  outs = convos.map do |convo|
    convo.add_tag( WpTag::TRASH )
    convo.remove_tag( WpTag::INBOX )
  end
  flash[:notice] = "outcome: #{outs}"
  render json: { status: :ok }
end

#rmtagObject



12
13
14
15
16
17
18
19
20
# File 'app/controllers/ishapi/email_conversations_controller.rb', line 12

def rmtag
  authorize! :email_conversations_rmtag, ::Ishapi
  convos = Office::EmailConversation.find params[:ids]
  outs = convos.map do |convo|
    convo.rmtag( params[:emailtag] )
  end
  flash[:notice] = "outcome: #{outs}"
  render json: { status: :ok }
end