Fix ajax requests for caches

This commit is contained in:
Piotr Sarnacki 2015-02-10 10:09:51 +01:00
parent aacad11258
commit 6c01631b2e
3 changed files with 4 additions and 3 deletions

View File

@ -18,7 +18,7 @@ Controller = Ember.ObjectController.extend
deletingDone = => @set('isDeleting', false)
repo = @get('repo')
Ajax("/repos/#{repo.get('id')}/caches", "DELETE", data: data).then(deletingDone, deletingDone).then =>
Ajax.ajax("/repos/#{repo.get('id')}/caches", "DELETE", data: data).then(deletingDone, deletingDone).then =>
model = @get('model')
@get('controllers.caches').removeObject(model)

View File

@ -18,7 +18,7 @@ Controller = Ember.ObjectController.extend
deletingDone = => @set('isDeleting', false)
repo = @get('repo')
Ajax("/repos/#{repo.get('id')}/caches", "DELETE", data: data).then(deletingDone, deletingDone).then =>
Ajax.ajax("/repos/#{repo.get('id')}/caches", "DELETE", data: data).then(deletingDone, deletingDone).then =>
model = @get('model')
@get('parent.caches').removeObject(model)
if @get('parent.caches.length') == 0

View File

@ -1,4 +1,5 @@
`import Ember from 'ember'`
`import Ajax from 'travis/utils/ajax'`
Controller = Ember.ArrayController.extend
isDeleting: false
@ -15,7 +16,7 @@ Controller = Ember.ArrayController.extend
deletingDone = => @set('isDeleting', false)
repo = @get('repo')
Travis.ajax.ajax("/repos/#{repo.get('id')}/caches", "DELETE").then(deletingDone, deletingDone).then =>
Ajax.ajax("/repos/#{repo.get('id')}/caches", "DELETE").then(deletingDone, deletingDone).then =>
@clear()
`export default Controller`