Skip to content

Commit 9906f6c

Browse files
improve performance
1 parent 6b6d6c0 commit 9906f6c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/app/admin/dashboard/page.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import { getCategoryData } from '@/actions/categories'
44
import { getLatestUsers } from '@/actions/auth'
55

66
const Dashboard = async () => {
7-
// const monthlyOrders = await getMonthlyOrders()
8-
// const categoryData = await getCategoryData()
9-
// const latestUsers = await getLatestUsers()
107
const [monthlyOrders, categoryData, latestUsers] = await Promise.all([
118
getMonthlyOrders(),
129
getCategoryData(),

src/app/admin/products/page.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ import { getProductsWithCategories } from '@/actions/products'
33
import { ProductPageComponent } from '@/app/admin/products/page-component'
44

55
export default async function Products() {
6-
const categories = await getCategoriesWithProducts()
7-
const productsWithCategories = await getProductsWithCategories()
6+
// const categories = await getCategoriesWithProducts()
7+
// const productsWithCategories = await getProductsWithCategories()
8+
const [categories, productsWithCategories] = await Promise.all([
9+
getCategoriesWithProducts(),
10+
getProductsWithCategories(),
11+
])
812

913
return (
1014
<ProductPageComponent

0 commit comments

Comments
 (0)