Skip to content

Commit

Permalink
[DXP-1074] remove prefix cutting from page path
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejmikolajczakds committed Aug 28, 2024
1 parent 4f3b0d0 commit 9948f25
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions applications/puresight/frontend/src/components/Search/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@ import {
getQueenSizeBedResults,
} from "./service";

const PATH_TO_REMOVE = "published/puresight/pages";

const getAutocompleteItemUrl = (item: Page) => {
return item.path.replace(PATH_TO_REMOVE, "");
};

const getItemTemplate = (html: HTMLTemplate, item: Page) => {
return html`<a class="aa-ItemLink" href=${getAutocompleteItemUrl(item)}>
return html`<a class="aa-ItemLink" href=${item.path}>
<div class="aa-ItemContent">
<div class="aa-ItemIcon aa-ItemIcon--alignTop">
<svg
Expand Down Expand Up @@ -81,7 +75,7 @@ autocomplete<Page>({
return pages.items;
},
getItemUrl({ item }) {
return getAutocompleteItemUrl(item);
return item.path;
},
templates: {
item({ item, html }) {
Expand All @@ -106,7 +100,7 @@ autocomplete<Page>({
return response.items;
},
getItemUrl({ item }) {
return getAutocompleteItemUrl(item);
return item.path;
},
templates: {
header({ html }) {
Expand Down Expand Up @@ -135,7 +129,7 @@ autocomplete<Page>({
return response.items;
},
getItemUrl({ item }) {
return getAutocompleteItemUrl(item);
return item.path;
},
templates: {
header({ html }) {
Expand All @@ -162,7 +156,7 @@ autocomplete<Page>({
return response.items;
},
getItemUrl({ item }) {
return getAutocompleteItemUrl(item);
return item.path;
},
templates: {
header({ html }) {
Expand Down

0 comments on commit 9948f25

Please sign in to comment.