feat(poc): test something

This commit is contained in:
Björn Meyer 2023-07-17 11:42:15 +02:00
parent cc07397793
commit 2ee6394d27
2 changed files with 3 additions and 2 deletions

View File

@ -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
} }
] ]
}; };

View File

@ -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);