Fix ajax requests for caches
This commit is contained in:
parent
aacad11258
commit
6c01631b2e
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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`
|
||||
|
|
Loading…
Reference in New Issue
Block a user