Sha256: b8081715de20916f2359d0181ade19f62036ea268653996634a2c1e9b133ef52

Contents?: true

Size: 580 Bytes

Versions: 1

Compression:

Stored size: 580 Bytes

Contents

Volontariat.DestroyBrainstorming = Em.Mixin.create
  actions:
    
    destroy: (user_slug, slug)  ->
      if Volontariat.User.current() == undefined || user_slug != Volontariat.User.current().slug
        @transitionToRoute 'index'
        Volontariat.alert 'danger', 'Access denied!'
      else
        $.ajax("/api/v1/brainstormings/#{slug}", type: 'DELETE').done((data) =>
          @transitionToRoute 'no_data'
          @transitionToRoute 'user_brainstormings', user_slug, 1 
        ).fail((data) ->
          Volontariat.alert 'danger', 'Removing item failed!'
        ) 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
voluntary_brainstorming-0.0.2 app/assets/javascripts/voluntary_brainstorming/mixins/destroy_brainstorming.js.coffee