Giter Site home page Giter Site logo

Comments (4)

evan108108 avatar evan108108 commented on July 26, 2024

Thanks. I am going to look into this...

from restfullyii.

evan108108 avatar evan108108 commented on July 26, 2024

Okay the latest Master branch has a fix. Thanks again for reporting this bug!

from restfullyii.

brendonbeebe avatar brendonbeebe commented on July 26, 2024

A related issue that I would like your feedback on.

If I have the following object
{
"id":"1",
"answer_id":1,
"answer":{"id":"1","quiz_id":"1","question":"What is your best color?","note":null}
}

If I change answer_id but don't change the id in answer object then the record isn't updated but the response from the rest api says "Record Updated." You can see the detailed requests below, I believe the correct functionality would be to have the response state that the record was not updated.

Send:
{
"id":"1",
"answer_id":3,
"answer":{"id":"1","quiz_id":"1","question":"What is your best color?","note":null}
}
Returns success but record was not updated

If how ever I send:
{
"id":"1",
"answer_id":3,
"answer":{"id":"3","quiz_id":"1","question":"What is your best color?","note":null}
}
Returns success and record updates.

from restfullyii.

evan108108 avatar evan108108 commented on July 26, 2024

Well as you know, you have a mismatch with your BelongsTo. You don't need to include both values, doing so is confusing the ORM. The record has in fact been updated in that the record has been saved, however your BelongsTo is being overwritten so your not seeing it there...

It's a commen problem and one that should be handled. Perhaps you can help me define a better default behavior?

Sent from Mailbox for iPhone

On Fri, Jul 26, 2013 at 11:55 PM, brendonbeebe [email protected]
wrote:

A related issue that I would like your feedback on.
If I have the following object
{
"id":"1",
"answer_id":1,
"answer":{"id":"1","quiz_id":"1","question":"What is your best color?","note":null}
}
If I change answer_id but don't change the id in answer object then the record isn't updated but the response from the rest api says "Record Updated." You can see the detailed requests below, I believe the correct functionality would be to have the response state that the record was not updated.
Send:
{
"id":"1",
"answer_id":3,
"answer":{"id":"1","quiz_id":"1","question":"What is your best color?","note":null}
}
Returns success but record was not updated
If how ever I send:
{
"id":"1",
"answer_id":3,
"answer":{"id":"3","quiz_id":"1","question":"What is your best color?","note":null}
}

Returns success and record updates.

Reply to this email directly or view it on GitHub:
#31 (comment)

from restfullyii.

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.