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

feat(model): add support to configuration at query builder #142

Merged
merged 11 commits into from
Nov 9, 2020

Conversation

JoaoPedroAS51
Copy link
Collaborator

@JoaoPedroAS51 JoaoPedroAS51 commented Nov 6, 2020

Add a new method config to Model.js. It can be used to override the http instance (e.g. axios) configuration at query builder.
It can be used to change the method of update request to PATCH, to add additional data to the request, to add headers, and so on.

TODO

  • Update documentation
  • Remove method updateMethod

Usage

await Model.config({ method: 'PATCH' }).save()

await Model.config({ headers: { ... }, data: { foo: 'bar' } }).save()

@JoaoPedroAS51 JoaoPedroAS51 marked this pull request as ready for review November 6, 2020 20:26
tests/model.test.js Outdated Show resolved Hide resolved
@JoaoPedroAS51 JoaoPedroAS51 merged commit e46d63e into dev Nov 9, 2020
@JoaoPedroAS51 JoaoPedroAS51 deleted the feat/config branch November 9, 2020 03:40
@github-actions
Copy link

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants