keikaavousi/fake-store-api

POST apis are returning just an object with id prop only

avinashcodelabs opened this issue · 3 comments

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.

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.