mirror of
https://github.com/vercel/commerce.git
synced 2025-06-16 04:11:22 +00:00
25 lines
512 B
TypeScript
25 lines
512 B
TypeScript
import spree from '@commerce/index';
|
|
import Alphabet from 'components/tests/alphabet';
|
|
import TestsTable from 'components/tests/tests-table';
|
|
|
|
async function getProducts() {
|
|
const res = await spree.products.list({});
|
|
|
|
if (!res.isSuccess()) {
|
|
throw new Error('Failed to fetch data');
|
|
}
|
|
|
|
return res.success().data;
|
|
}
|
|
|
|
export default async function TestsPage() {
|
|
const products = await getProducts();
|
|
|
|
return (
|
|
<div>
|
|
<Alphabet />
|
|
<TestsTable products={products} />
|
|
</div>
|
|
);
|
|
}
|