You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello.
I have a restful backend that contains companies and each company has a list of services. I get a companies list of services at the URL "company/{companyId}/servicelist"
However each service is also considered a "top level" entity. To update a service I need to send a PUT request to the address "service/{serviceId}".
If i retreive the list of services for a company with Restangular, each one of the retreived services will have an "incorrect" route. Like this:
Restangular.one("company", 42).all("servicelist").getList().then(function(serviceList) {
var firstService = serviceList[0]; // firstService.id is 1.
firstService.name = "A new name";
firstService.put(); // will post to company/42/servicelist/1
});
Can I configure this so that the PUT request will be sent to "service/1"?
The text was updated successfully, but these errors were encountered:
Looks promising but when I use the the code you provided, the service still has the parentResource "company" after calling restangularizeElement with null as the first argument. Is this correct?
Hello.
I have a restful backend that contains companies and each company has a list of services. I get a companies list of services at the URL "company/{companyId}/servicelist"
However each service is also considered a "top level" entity. To update a service I need to send a PUT request to the address "service/{serviceId}".
If i retreive the list of services for a company with Restangular, each one of the retreived services will have an "incorrect" route. Like this:
Can I configure this so that the PUT request will be sent to "service/1"?
The text was updated successfully, but these errors were encountered: