Grails 2.4.2
I have a UserController and in its save method, I need to pass in an Organization ID along with the User data so that I can find the Organization and then create the many-to-many relationship. So I have something like this...
def save(User user) {
def orgExternalId = request.JSON.orgExternalId
userService.save(user, orgExternalId)
// more boilerplate
}
I'm POST'ing the following json:
{
"orgExternalId" : "123445",
"firstName": "gregg",
"lastName": "bolinger",
"username": "gdboling"
}
However, I'm not getting the orgExternalId out of the JSON in my controller. Also, if I inspect the JSON, it is empty, but the User domain is populated correctly. My assumption at this point is I'm going to have to use a Command Object or I could put the orgExternalId in the header, but I'd like to know if there is another way.