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.

Get order summary

Get order summary

All right guys, so now we want to work on the admin overview area and just to give you an idea of what it's going to look like, it's going to have the total revenue, the accounts for the sales, the customers' products. It's going to have a chart. We're going to use the recharts package and have monthly sales and then the latest six sales or how, yeah, six, all right. And obviously we need a way to get this data. So that's what we're doing in this video is creating an action that will return all this data. Okay, and then after that we can start to work on the actual UI. So where this is going to go is in your order actions file, and we're going to go all the way down to the bottom and create a new function. So let's say get sales data, say get sales data for the, or just say get sales data and order summary, because it's going to be called get order summary. So let's say export async function and let's call it Get Order Summary, it's not going to take anything in and there's four…

Contents