Join our community

Get access to the complete guide to developing and deploying fast, production-ready Nuxt apps.

6-4 Add Endpoint to Update Progress

In this lesson, we add an endpoint that lets us update a user’s course progress.

We rely on the unique field we created in the previous lesson so we can grab a specific object. Without this, we aren’t able to update the object in the database.

Lastly, we update our Pinia store to call this endpoint. But we take advantage of optimistic updating — we update the UI immediately, but if the request fails we roll back the update so our UI matches our database.