Skip to content

Commit

Permalink
Rename "version" to "subPath" in UrlReplaceMapCodec
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobottaro committed Dec 17, 2024
1 parent 63c19a7 commit c1a3c22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tall-boxes-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": minor
---

Rename "version" to "subPath" in UrlReplaceMapCodec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NullToUndefinedCodec } from './NullToUndefinedCodec';
const UrlToGuideCodec = t.strict({
id: t.number,
url: t.string,
version: t.union([NullToUndefinedCodec, t.string]),
subPath: t.union([NullToUndefinedCodec, t.string]),
guide: t.strict({
data: t.union([NullToUndefinedCodec, GuideCodec]),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function makeUrlReplaceMap(
[obj.url]: `/${
obj.guide.data?.attributes.product.data.attributes.slug
}/guides/${obj.guide.data?.attributes.slug}${
obj.version ? `/${obj.version}` : ''
obj.subPath ? `/${obj.subPath}` : ''
}`,
};
}, {} as UrlReplaceMap);
Expand Down

0 comments on commit c1a3c22

Please sign in to comment.