Skip to content

Commit 9ddd5c8

Browse files
guitavanoclaude
andauthored
fix(vtex): check for :slug prefix instead of just : in PDP loaders (#1638)
The slug check was too broad, matching any string starting with ":" instead of specifically checking for the ":slug" placeholder. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8042005 commit 9ddd5c8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

vtex/loaders/intelligentSearch/productDetailsPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const loader = async (
7171
const { vcsDeprecated } = ctx;
7272
const { url: baseUrl } = req;
7373
const { slug } = props;
74-
const haveToUseSlug = slug && !slug.startsWith(":");
74+
const haveToUseSlug = slug && !slug.startsWith(":slug");
7575
let defaultPaths;
7676

7777
if (!haveToUseSlug) {

vtex/loaders/legacy/productDetailsPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function loader(
4545
const { vcsDeprecated } = ctx;
4646
const { url: baseUrl } = req;
4747
const { slug } = props;
48-
const haveToUseSlug = slug && !slug.startsWith(":");
48+
const haveToUseSlug = slug && !slug.startsWith(":slug");
4949
let defaultPaths;
5050
if (!haveToUseSlug) {
5151
defaultPaths = await PDPDefaultPath({ count: 1 }, req, ctx);

0 commit comments

Comments
 (0)