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 { HomeLayoutPageHeader } from '../../_components/home-page-header';
|
||||||
import OrderBlock from '../../_components/orders/order-block';
|
import OrderBlock from '../../_components/orders/order-block';
|
||||||
|
|
||||||
|
const ORDERS_LIMIT = 50;
|
||||||
|
|
||||||
export async function generateMetadata() {
|
export async function generateMetadata() {
|
||||||
const { t } = await createI18nServerInstance();
|
const { t } = await createI18nServerInstance();
|
||||||
|
|
||||||
@@ -26,9 +28,11 @@ export async function generateMetadata() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function OrdersPage() {
|
async function OrdersPage() {
|
||||||
const medusaOrders = await listOrders();
|
const [medusaOrders, analysisOrders, { productTypes }] = await Promise.all([
|
||||||
const analysisOrders = await getAnalysisOrders();
|
listOrders(ORDERS_LIMIT),
|
||||||
const { productTypes } = await listProductTypes();
|
getAnalysisOrders(),
|
||||||
|
listProductTypes(),
|
||||||
|
]);
|
||||||
|
|
||||||
if (!medusaOrders || !productTypes) {
|
if (!medusaOrders || !productTypes) {
|
||||||
redirect(pathsConfig.auth.signIn);
|
redirect(pathsConfig.auth.signIn);
|
||||||
|
|||||||
Reference in New Issue
Block a user