# Remove from store on successfull destroy

**URL:** <https://discuss.emberjs.com/t/remove-from-store-on-successfull-destroy/4325>\
**Category:** Ember Data\
**Created:** [March 1, 2014, 3:43pm UTC](https://discuss.emberjs.com/t/remove-from-store-on-successfull-destroy/4325 "2014-03-01T15:43:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikezaby](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/mikezaby/32/5414_2.png) [@mikezaby](https://discuss.emberjs.com/u/mikezaby)\
**Post date:** [March 1, 2014, 3:43pm UTC](https://discuss.emberjs.com/t/remove-from-store-on-successfull-destroy/4325/1 "2014-03-01T15:43:24Z")

</div>

I use `destroyRecord` in a delete action like this

```
App.PostController = Ember.ArrayController.extend
  actions:
    destroy: (post)-> post.destroyRecord()

```

But this is removing the post from store even if the request fail. I have a solution but i dont like it.

```
App.PostController = Ember.ArrayController.extend
  actions:
    destroy: (post)-> 
      post.destroyRecord().then(
        () =>, #success
        (error) => post.rollback() #error
      )

```

I prefer the opposite behavior, on success remove the post from store, on fail do nothing or show an error message. Is there a way to do this?
