I'm currently working on adding objects to a JSON list in Grails. Below is the Angular code I am using: http://pastebin.com/4ypijUMD
Additionally, here is my Grails controller: http://pastebin.com/skTtVtxv
My understanding is that the angularJS script should send a request to access the add controller with the information from the most recent member of the list.
Subsequently, the add function should generate a new JSON object based on the parameters passed into the controller from the angular script and everything should work smoothly.
Unfortunately, when trying to update my list using the update controller, I encounter an issue where no new objects are created and I end up getting null values.
list with my update controller:
def saveList() {
def newItem = Item.findById(request.JSON.id)
newItem.name = request.JSON.name
newItem.type = request.JSON.type
newItem.priority = request.JSON.priority
newItem.completed = request.JSON.completed
newItem.save(flush: true)
render newItem as JSON
}