Giter Club home page Giter Club logo

Comments (9)

imRohan avatar imRohan commented on July 28, 2024 1

@tudorels Theput route allows you to perform a deep merge of objects. It merges the new data you provide with the existing contents of the basket.

For your use-case, perhaps look into structuring your basket with an array of users like so:
{ "users": [ { "username": "user1", "password": "pass123"}, {"username": "user2", "password": "pass234"} ] }

That way you can add new users to your array by sending a put request with the body
{ "users": [ {"username": "user3", "password": "pass345"} ] }

The response of this put call will be an array of 3 users.

from pantry.

imRohan avatar imRohan commented on July 28, 2024

Hey @tudorels, it seems like you're trying to create a basket without supplying any object as the payload. Can you please post the request payload of the POST request?

from pantry.

tudorels avatar tudorels commented on July 28, 2024

https://getpantry.cloud/apiv1/pantry/myPantryID/basket/testbasket

like I saw in docs to create a basket

from pantry.

tudorels avatar tudorels commented on July 28, 2024

Is mandatory to insert some data in basket. I can not create an empty basket? Why?

from pantry.

imRohan avatar imRohan commented on July 28, 2024

Unfortunately yes, a basket cannot be empty. For now, would you be able to work around this limitation? In the meantime, I'll figure out a way to allow users to create empty baskets in their pantry.

from pantry.

tudorels avatar tudorels commented on July 28, 2024

It's ok for now. I'm also interested in adding new data in basket along with other data already existing in basket, like adding new record in other database system. It is posible? I've seen the other issue and you said it will be posible with put method. It will be very usefull to add new record in basket. Thanks!

from pantry.

imRohan avatar imRohan commented on July 28, 2024

Ok sounds good! I agree that adding new data to existing baskets is definitely useful, and ill probably go the PUT route. Going to close this issue for now and continue discussions on this issue regarding the new update basket feature.

from pantry.

imRohan avatar imRohan commented on July 28, 2024

@tudorels Just an update, I've added a put route to the API to allow users to add new data to an existing basket, you can check it out it here! Please let me know if this works better for you.

from pantry.

tudorels avatar tudorels commented on July 28, 2024

Maybe, I don't understand how is working ... I've made a basket "users" and I tried to add some records like this:
{ "username":"tudor", "password":"test1234$"} - this is first user
{"username":"tedi", "password":"test1234$"} -second user added with put
when I query the basket I get only second user. Maybe the basket is not like a collection. You must clarify this, how can we use this in real world. If you want to introduce a new concept nosql database, you must explain the concept and it must be made to easy understand and use. Till now I don't understand how it must work ...and how I can use this service ...
Thank you!

from pantry.

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.