mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 05:56:59 +00:00
feat(poc): test something
This commit is contained in:
parent
cc07397793
commit
2ee6394d27
@ -169,6 +169,7 @@ export async function requestSeoUrl(
|
|||||||
limit: number = 1
|
limit: number = 1
|
||||||
): Promise<SeoURLResultSW | undefined> {
|
): Promise<SeoURLResultSW | undefined> {
|
||||||
try {
|
try {
|
||||||
|
const testing = handle.replace('cms/', '').replace('product/', '').replace('search/', '');
|
||||||
const criteria = {
|
const criteria = {
|
||||||
page: page,
|
page: page,
|
||||||
limit: limit,
|
limit: limit,
|
||||||
@ -176,7 +177,7 @@ export async function requestSeoUrl(
|
|||||||
{
|
{
|
||||||
type: 'contains',
|
type: 'contains',
|
||||||
field: 'seoPathInfo',
|
field: 'seoPathInfo',
|
||||||
value: handle
|
value: testing
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@ -53,7 +53,7 @@ export async function getMenu(params?: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getPage(handle: string | []): Promise<Page | undefined> {
|
export async function getPage(handle: string | []): Promise<Page | undefined> {
|
||||||
const pageHandle = decodeURIComponent(transformHandle(handle)).replace('cms/', '');
|
const pageHandle = decodeURIComponent(transformHandle(handle));
|
||||||
const seoUrlElement = await getFirstSeoUrlElement(pageHandle);
|
const seoUrlElement = await getFirstSeoUrlElement(pageHandle);
|
||||||
if (seoUrlElement) {
|
if (seoUrlElement) {
|
||||||
const category = await getCategory(seoUrlElement);
|
const category = await getCategory(seoUrlElement);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user