remove parent route after creating new resource
My API looks like the following:
/jobs/xxx/invoices - POST (create a new invoice against a job)
/service-calls/xxx/invoices - POST (create a new invoice against a service call)
/invoices - GET, PUT/PATCH, DELETE (view, edit, update an invoice regardless of what it is attached too)
After I save/create a new invoice I don't want it to be a nested resource anymore. Currently I am just setting parentResource = null and this seems to work but just wanted to check if this is the best way.
+1 When II POST to restangular resource got using restangular.get('user',111111) using User.post('app',{}) i get back an object that has no parent. (checking via parentResource property) I confirmed that when using restangular 1.4 I get the expected user parent, we will be happy to provide further info if needed
+1 (but not exactly) Please check my question on SO: http://stackoverflow.com/questions/36344618/how-do-i-perform-specific-parentless-requests-using-restangular-in-a-neat-way