From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Order page and action - Next.js Tutorial
From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch
Order page and action
Okay, so now we want to get the the order details and it's going to be for this order slash and then the ID page And we need to have an action to get this order and then we need to display it in a page now There's one small change that I want you to make before we get into any of this and that's going to be in your Prisma Schema, so if you open that up and you go to your order model, you're gonna see this Order items so uppercase O and I and singular what I want you to do is change that to order items all lowercase Which is just a better convention when we're when we're in this context where the order items They they belong to the order much like these other fields even though it's a relationship I just think it makes more sense and we're going to be using this in the query that we're about to write So I just think it makes more sense If you want to keep it as order item you can and then you can just keep that in the query when we write it But I would say change it and then you're…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Section intro1m 31s
-
(Locked)
Payment method and Zod schemas9m 27s
-
(Locked)
Payment method page8m 1s
-
(Locked)
Payment method form and update13m 9s
-
(Locked)
Order and OrderItem Prisma models11m 7s
-
(Locked)
Order Zod schemas and types8m 16s
-
(Locked)
Place order page18m 5s
-
(Locked)
Create order action14m 15s
-
(Locked)
Place order form7m 37s
-
(Locked)
Order page and action8m 27s
-
(Locked)
Format utility functions8m 20s
-
(Locked)
Order details table14m 5s
-
(Locked)
-
-
-
-
-
-
-
-
-
-