Code Monkey home page Code Monkey logo

Comments (8)

guylabs avatar guylabs commented on July 3, 2024

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.

rkusuma avatar rkusuma commented on July 3, 2024

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.

rkusuma avatar rkusuma commented on July 3, 2024

@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.

guylabs avatar guylabs commented on July 3, 2024

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.

rkusuma avatar rkusuma commented on July 3, 2024

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.

guylabs avatar guylabs commented on July 3, 2024

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.

rkusuma avatar rkusuma commented on July 3, 2024

👍
I really like this angular-spring-data-rest. It helps me a lot.

Thanks Guy

from angular-spring-data-rest.

guylabs avatar guylabs commented on July 3, 2024

Thanks for the praise :).

Regards,

Guy

from angular-spring-data-rest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.