qumra-engine 2.0.158 → 2.0.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,7 +11,6 @@ function renderHandler(locals) {
|
|
|
11
11
|
const settings = locals?.env?.getGlobal("settings");
|
|
12
12
|
const lang = locals?.lang;
|
|
13
13
|
const market = locals?.render?.market;
|
|
14
|
-
console.log("🚀 ~ renderHandler ~ market:", market);
|
|
15
14
|
const currency = market?.targetCurrencyId;
|
|
16
15
|
const localesPath = locals?.localsPath;
|
|
17
16
|
let languages = [];
|
|
@@ -69,14 +69,14 @@ const prepareDataMiddleware = (req, res, next) => {
|
|
|
69
69
|
if (parsedUrl.host !== expectedHost &&
|
|
70
70
|
!currentUrl.includes("localhost")) {
|
|
71
71
|
// redirect to expected host
|
|
72
|
-
return res.redirect(
|
|
72
|
+
return res.redirect(307, `${backendUrl}${parsedUrl.pathname}`);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
res.locals.render = engineResponse.data?.data;
|
|
76
76
|
next();
|
|
77
77
|
})
|
|
78
78
|
.catch((err) => {
|
|
79
|
-
console.log("❌ prepareDataMiddleware error:", err);
|
|
79
|
+
console.log("❌ prepareDataMiddleware error:", err.message);
|
|
80
80
|
next(err);
|
|
81
81
|
});
|
|
82
82
|
};
|
|
@@ -16,7 +16,7 @@ const renderMiddleware = (req, res, next) => {
|
|
|
16
16
|
const env = res.locals.env;
|
|
17
17
|
const pageLayout = env.getGlobal("pageData").layout ?? "layout";
|
|
18
18
|
if (widgetId && jsonPreview === "true") {
|
|
19
|
-
const overrideLayout = `{% content %}`;
|
|
19
|
+
const overrideLayout = `{% content " " %}`;
|
|
20
20
|
env.renderString(overrideLayout,
|
|
21
21
|
// resolveTranslations(
|
|
22
22
|
{
|