Skip to content

Commit

Permalink
refactor(@dpc-sdp/ripple-tide-api): ♻️ use existing util
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingallday committed Dec 5, 2024
1 parent 50790a7 commit 170ff15
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { stripSiteId } from '../../utils/stripSiteId.js'

type LinksetMenu = {
href: string
title: string
Expand Down Expand Up @@ -41,7 +43,7 @@ const processNode = (linkset: LinksetMenu[], parentKey: string, level = 1) => {
if (level === 1 || nodeKey.startsWith(parentKey)) {
const values: ProcessedMenu = {
text: link.title,
url: link.href.replace(/\/site-(\d+)/, ''),
url: stripSiteId(link.href),
id: nodeKey,
parent: level === 1 ? null : parentKey
}
Expand Down

0 comments on commit 170ff15

Please sign in to comment.