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
18 lessons
7 lessons
7 lessons
11 lessons
18 lessons
8 lessons
17 lessons