Comments (3)
I've run into that same problem myself, but I'm not sure how exactly to pull that off since technically .get
is a valid API, just not for making requests.
We could look at overriding the .get
method, checking against a whitelist of valid properties and sending that error if it doesn't match. However, then we have to keep that list up to date and I'm not sure it would play too nicely with the fact that we use an ES6 class under the hood.... So my inclination is that that wouldn't be a good solution.
@taras do you have any suggestions? As much as I think this would be a great thing to have, I'm just not sure how we would do it since .get
is Ember's API
from ember-ajax.
@alexlafroscia we could overload get
method and check for how many arguments are passed. If we detect that the user is using get as GET then throw a warning into the console. We won't be able to check in situation when someone does this.get('/someResource')
but it's better than nothing.
What do you think?
from ember-ajax.
Yeah, that seems like a good compromise. We could even try to catch instances where the parameter to .get
starts with a /
to attempt warning about that use case as well.
I'm wondering how implementation would go, since the ES6 class is converted into a Mixin and then applied to the Service that way. I'll mess around with it tonight or tomorrow and see what I can do.
Other than the warning, what should the behavior be? Still proxy through to Ember's .get
method, or should we actually throw an error to really draw attention to it?
from ember-ajax.
Related Issues (20)
- Release notes error? HOT 1
- Is this package deprecated? HOT 7
- allow host and namespace be empty
- Unable to extract error if server return `application/problem+json` header
- Cannot override ajax service HOT 17
- Host does not resolve when the start of the path is the same string as the namespace.
- ember-ajax does not work with Ember 3.8 when transpiling to ES5 HOT 1
- importing `ember-ajax/errors` is broken with `ember-cli-typescript` HOT 4
- Fails with Octane blueprint HOT 6
- Remove requirement that TS consumers must enable allowSyntheticDefaultImports
- Update README to remove unhelpful wording, move contributions
- Request URL
- deprecation warning ember 3.9 - computed-property.volatile HOT 3
- Use with VSCode typechecking in .js files
- Using run.join not working with thrown error
- Any plans to switch to fetch? HOT 7
- Deprecation warnings with Ember 3.27
- [5.1.0] Type-definitions are missing from release HOT 3
- Does this addon work with ember octane versions ? HOT 3
- How to use error handler helpers in glimmer version? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-ajax.