mirror of
https://github.com/vercel/commerce.git
synced 2025-06-17 12:41:21 +00:00
23 lines
636 B
TypeScript
23 lines
636 B
TypeScript
import spree from '@commerce/client';
|
|
import DiseasesAndConditions from 'components/diseases/diseases-and-conditions';
|
|
import Specialities from 'components/diseases/specialities';
|
|
import { cache } from 'react';
|
|
|
|
const getTaxons = cache(async (id: string) => {
|
|
console.log('getTaxons');
|
|
const res = await spree.taxons.list({});
|
|
if (res.isFail()) throw new Error('Failed to fetch data');
|
|
return res.success().data;
|
|
});
|
|
|
|
export default async function DiseasesPage() {
|
|
const taxons = await getTaxons();
|
|
|
|
return (
|
|
<div>
|
|
<Specialities taxons={taxons} />
|
|
<DiseasesAndConditions taxons={taxons} />
|
|
</div>
|
|
);
|
|
}
|