Join our community

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

5-14 Update Course Meta Endpoint

In this lesson we update our course meta endpoint to grab our data using Prisma.

We use the include shortcut along with generated types for added type safety. We then update the useCourse function to use our new type, and get rid of most of our custom types (that are now redundant).

Finally, we delete the courseData from the server. All data is now being served from our database!

UPDATE, December 2023: There’s a bug in this lesson that’s fixed in lesson 6-2, but the code repo has been updated to include this fix a bit earlier on so the app continues to work as expected.

Generated types in Prisma: https://www.prisma.io/docs/concepts/components/prisma-client/advanced-type-safety/operating-against-partial-structures-of-model-types