I'm doing a user management. At the moment, I'm creating the put to edit. But, I do not know how to bring the id on the route.
There is a list of users and also an insert. When the client clicks on the button to recover the password, I would like it to already bring the user id and thus put the put.
So the update (the user.id is coming undefined because the route is not bringing):
update(user: User) {
this.endpoint = '/users/' + user.id;
return this.service.put(this.endpoint, user);
}
And here's the put:
put(path: String, params) {
return this.http.put(this.url + path, params, this.standardHeaders()).map((response: Response) => {
return response.text().length > 0 ? response.json() : {};
});
}