Comments (8)
Hi,
do you use Spring Data REST? If not I think I cannot give you support for that as this library is for Spring Data REST and the other usages are not supported and I think it is not a proper REST API if it returns a 204
instead of a 404
.
You are able to implement your own fetchFunction
(https://github.com/guylabs/angular-spring-data-rest#exchange-the-underlying-fetch-function) and then change this part here: https://github.com/guylabs/angular-spring-data-rest/blob/master/src/angular-spring-data-rest-provider.js#L105.
Then you can handle the 204
responses.
Thanks and regards,
Guy
from angular-spring-data-rest.
Yes we use Spring Data REST.
Initialy we return 404
.. but that's make log console browser full of 404
log, so we change to 204
.
If i implement my own fetchFunction
, i can't use your processData
function.
from angular-spring-data-rest.
@guylabs
What i want if there is 204
code, i want append that link to the data with null
value.
The code is something like this:
if (responseData.status == 204) {
return $injector.get("$q").when(data).then(function() {
data[key] = null;
});
}
and add it in https://github.com/guylabs/angular-spring-data-rest/blob/master/src/angular-spring-data-rest-provider.js#L93
What do you think ?
from angular-spring-data-rest.
Well in my opinion it is not a good idea to add this to the core as a 204
means something completely different and its not the standard how REST should be used.
And this is not Angular which logs them, but the browser itself, and therefore I wouldn't change the semantics of REST just to avoid these kind of logs. The normal users will never see these logs anyway. Here some links how to solve it in Chrome:
https://stackoverflow.com/questions/24207143/angular-avoid-console-trace-on-http-error
https://stackoverflow.com/questions/14337351/can-i-prevent-the-chrome-developer-tools-console-from-logging-image-404-errors/14427545#14427545
So therefore I would close this issue if it is ok with you.
Thanks and regards,
Guy
from angular-spring-data-rest.
I see.. i'm ok with that..
last thing.. if i get 404
that means you skip that link?
For example:
SpringDataRestAdapter.process(response, ['link', 'link2', 'link3']).then(function(result) {
....
});
if link2
get 404
.. result
will only have link
and link2
or skip all links?
from angular-spring-data-rest.
Well as you see it here: https://github.com/guylabs/angular-spring-data-rest/blob/master/src/angular-spring-data-rest-provider.js#L105
If one of those return a 404
then this link won't be fetched but the others will. So then I close the issue.
Thanks for using the component! :)
Regards,
Guy
from angular-spring-data-rest.
👍
I really like this angular-spring-data-rest. It helps me a lot.
Thanks Guy
from angular-spring-data-rest.
Thanks for the praise :).
Regards,
Guy
from angular-spring-data-rest.
Related Issues (20)
- Given data is not of type object. HOT 6
- Fetch recursive causes infinite loop HOT 19
- Cache in $http HOT 2
- Would it be possible to provide the lib through a cdn? HOT 5
- Allow AngularJS dependency version 1.4 HOT 1
- Handling spring data rest exception HOT 2
- How to chain resources calls HOT 3
- Support Angular 1.5 HOT 6
- Correct use of resources children HOT 3
- Populate all references to the same resource HOT 8
- Collection of Links HOT 2
- Fetching resources compatible with saving HOT 2
- Inheritance support HOT 5
- Draft a new release for 1.5 support HOT 2
- POST with Spring projections? HOT 2
- "Given data '' is not of type object." when empty array response. HOT 12
- Automatically retrieve links in an object property HOT 1
- Release of version 0.4.6? HOT 1
- Not able to fetch underlying link data HOT 6
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 angular-spring-data-rest.