feat(MED-97): update orders page to load more than 10 orders
This commit is contained in:
@@ -17,6 +17,8 @@ import { listOrders } from '~/medusa/lib/data/orders';
|
||||
import { HomeLayoutPageHeader } from '../../_components/home-page-header';
|
||||
import OrderBlock from '../../_components/orders/order-block';
|
||||
|
||||
const ORDERS_LIMIT = 50;
|
||||
|
||||
export async function generateMetadata() {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
@@ -26,9 +28,11 @@ export async function generateMetadata() {
|
||||
}
|
||||
|
||||
async function OrdersPage() {
|
||||
const medusaOrders = await listOrders();
|
||||
const analysisOrders = await getAnalysisOrders();
|
||||
const { productTypes } = await listProductTypes();
|
||||
const [medusaOrders, analysisOrders, { productTypes }] = await Promise.all([
|
||||
listOrders(ORDERS_LIMIT),
|
||||
getAnalysisOrders(),
|
||||
listProductTypes(),
|
||||
]);
|
||||
|
||||
if (!medusaOrders || !productTypes) {
|
||||
redirect(pathsConfig.auth.signIn);
|
||||
|
||||
Reference in New Issue
Block a user