Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST apis are returning just an object with id prop only #113

Open
avinashcodelabs opened this issue Oct 6, 2023 · 3 comments
Open

POST apis are returning just an object with id prop only #113

avinashcodelabs opened this issue Oct 6, 2023 · 3 comments

Comments

@avinashcodelabs
Copy link

Hi,

I am trying out add product api - POST verb,

   fetch("https://fakestoreapi.com/products", {
      method: "POST",
      body: JSON.stringify({
        title: "test product",
        price: 13.5,
        description: "lorem ipsum set",
        image: "https://i.pravatar.cc",
        category: "electronic",
      }),
    })
      .then((res) => res.json())
      .then((json) => console.log(json));

The above code returns just an object with id prop, expected behaviour is, it should return an object with id prop along with other props as well.

{id: 21}

Let me know if you need help in reproducing the issue or PR with a fix, just wanted to comfirm with you before digging deep on the issue.

@keikaavousi
Copy link
Owner

keikaavousi commented Oct 6, 2023 via email

@avinashcodelabs
Copy link
Author

Hi @keikaavousi,
Thanks for the quick reply.
Has anyone working in it "return full props"?
I would like to contribute to it, let me know if you need any help, I am proficient in JavaScript, Node.js and Express.

@keikaavousi
Copy link
Owner

keikaavousi commented Oct 9, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants