hoodiehq-archive / hoodie-electron-app

https://rookies-rgsoc2016.github.io/hoodie-electron-app/
Apache License 2.0
5 stars 1 forks source link

Delete Api #44

Closed titay2 closed 8 years ago

flyjwayur commented 8 years ago

I am working on fixing Delete API problem that the app is not deleted after deleting one app. After adding app to the promise return and console.log 'id', it seems that I found one problem. The app dose not get the 'app id' from ' id: $('#delete-button').data('id')' or ' id = $('#delete-button').data('id'), so it can not pass the id to applist.remove API. I wonder whether it needs to be app.id or id for removing the app? :D

$deleteButton.on('click',function(event){
  event.preventDefault()
  var app = {
    id: $('#delete-button').data('id')
  }
  //var id = $('#delete-button').data('id')
  //console.log(id)
  console.log(id)
  applist.find(id)
  .then (function(app){
    applist.remove(app)
    setRoute('')
    console.log("applist.remove(id)"+applist.remove(app))
  })
})
gr2m commented 8 years ago

that’s done 👍