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

Calling custom() before save() should trigger a console error #172

Closed
Peter-Krebs opened this issue Jan 18, 2021 · 1 comment · Fixed by #173
Closed

Calling custom() before save() should trigger a console error #172

Peter-Krebs opened this issue Jan 18, 2021 · 1 comment · Fixed by #173
Labels
enhancement New feature or request good first issue Good for newcomers released

Comments

@Peter-Krebs
Copy link
Collaborator

Building the resource URL for the request is done for you by calling resource() of the model you are creating the request with.
This can be overridden with custom() for GET requests and for() for POST/PUT/PATCH/DELETE requests.

Users of the library often don't realize that custom() was made to query records on, for example, /posts/latest which is a conceivable resource URL. It is not RESTful to save/delete records on endpoints such as this.

People should be made aware that for() needs to be used for saving/deleting records.

The library should output a console error if save() is called after custom().

@Peter-Krebs Peter-Krebs added enhancement New feature or request good first issue Good for newcomers labels Jan 18, 2021
JoaoPedroAS51 added a commit that referenced this issue Jan 19, 2021
Throw an error if CRUD or relationship operations are used in in conjunction with the `custom` method.

Fixes #172
@github-actions
Copy link

🎉 This issue has been resolved in version 1.9.1 🎉

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
enhancement New feature or request good first issue Good for newcomers released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant