[Vuejs]-Newly added post takes the likes and comment counts of previous post in vue.js/laravel project

0👍

Its a little strange to me that you’re issuing GET /post after submitting the new post instead of GET /post/:id. Or just adding the created response onto your’re existing array.

/edit Disregard the above, I see you’re just re-running the method that gets all the posts. The singular post is confusing there, maybe that ought to be /posts 🙂

The issue may be related to the key on v-for, try using the id of your posts there.

Leave a comment