Skip to content

Commit 76e983f

Browse files
committed
refactored passing locale to placeholder to pass test
1 parent 3e31aae commit 76e983f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Routers/PagesRouter.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,13 @@ export class PagesRouter extends PromiseRouter {
341341

342342
// Get parameters
343343
const params = this.getDefaultParams(req.config);
344-
params.locale = this.getLocale(req);
344+
const locale = this.getLocale(req);
345+
if (locale) {
346+
params.locale = locale;
347+
}
345348

346349
// Get JSON placeholders
347-
const placeholders = this.getJsonPlaceholders(params.locale, params);
350+
const placeholders = this.getJsonPlaceholders(locale, params);
348351

349352
return this.pageResponse(absolutePath, params, placeholders);
350353
}

0 commit comments

Comments
 (0)