DEV Community

Discussion on: Headless WordPress with Sapper (Part 1)

 
shriji profile image
Shriji

That's odd, what seems to be the error?

Thread Thread
 
anilbhattaraitoronto profile image
Anil Bhattarai

I saw that the json that I received was an array, not a single object. Therefore, I did iterate for arr[0] to get that single object.

Thread Thread
 
anilbhattaraitoronto profile image
Anil Bhattarai

In the [slug] page I did this: return { post: data[0] };

Thread Thread
 
shriji profile image
Shriji

Yes that is right, I have covered it in the next post there are 5 parts right now.

Also I have pushed my repo github.com/peopledrivemecrazy/Sapp...