Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "PATCH" request method for "updateAttributes" model method/hook #282

Closed
3 tasks done
suryakand opened this issue Dec 29, 2016 · 8 comments · Fixed by #336
Closed
3 tasks done

Support "PATCH" request method for "updateAttributes" model method/hook #282

suryakand opened this issue Dec 29, 2016 · 8 comments · Fixed by #336

Comments

@suryakand
Copy link

suryakand commented Dec 29, 2016

What type of issue are you creating?

  • Bug
  • Enhancement

What version of this module are you using?

  • 2.0.10 (Stable)

Write other if any:

Please add a description for your issue:

Seem like in loopback's latest version they have implemented "PATCH" method (not PUT) for updating attributes on a model. The generated Angular2 SDK still generated "updateAttributes" method with "PUT" as request method. Please note "PATCH" method implementation may be only specific to Loopback 3.

Thanks,

  • Surya
@jonathan-casarrubias
Copy link
Collaborator

Hi @suryakand thanks for reporting,

We will start working on supporting LB3 soon :)

@PhilippeCorreges
Copy link

Hi @suryakand
Happy new year coding :-)
Could you please let me know which method I must use to update a model as doing a replaceById() does not work for me.

King Regards

@suryakand
Copy link
Author

@PhilippeCorreges have you tried updateAttributes method (if you are using version 3.x)?

@PhilippeCorreges
Copy link

@suryakand
thanks for your input.
I have seen this yesterday late evening and just tested it. The method works perfectly.

Thanks

@suryakand
Copy link
Author

@PhilippeCorreges glad that it worked for you!

@luisfavila
Copy link

@jonathan-casarrubias I keep needing to manually edit base.service.ts and change updateAttributes from PUT to PATCH

@barocsi
Copy link

barocsi commented Jan 18, 2018

@jonathan-casarrubias Same here. Please advise. Shall we need to manually override put to patch generally ?

@rheineo
Copy link

rheineo commented Sep 30, 2018

I in my component.ts agree on suscribe..

this.modelApi.updateAttributes(this.model.id, this.model).subscribe(
data => {
console.log(data);
},
error => {
console.log(error);
}
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants