forked from UKSOURCE/cms.hailearning.edu.vn
change || to ??
This commit is contained in:
@@ -19,7 +19,7 @@ exports.api = async (req, res) => {
|
||||
// Sử dụng helper để thêm base URL vào đường dẫn ảnh
|
||||
// Truyền baseUrl từ request hoặc từ environment
|
||||
const baseUrl =
|
||||
process.env.BACKEND_URL || `${req.protocol}://${req.get("host")}`;
|
||||
process.env.BACKEND_URL ?? `${req.protocol}://${req.get("host")}`;
|
||||
const processedData = addBaseUrlToImages(termsData, baseUrl);
|
||||
|
||||
res.json({
|
||||
@@ -57,7 +57,7 @@ exports.getTermsData = async (req, res) => {
|
||||
|
||||
// Thêm base URL vào đường dẫn ảnh
|
||||
const baseUrl =
|
||||
process.env.BACKEND_URL || `${req.protocol}://${req.get("host")}`;
|
||||
process.env.BACKEND_URL ?? `${req.protocol}://${req.get("host")}`;
|
||||
const processedData = addBaseUrlToImages(termsData, baseUrl);
|
||||
|
||||
res.json({
|
||||
@@ -91,7 +91,7 @@ exports.getByLanguage = async (req, res) => {
|
||||
|
||||
// Thêm base URL vào đường dẫn ảnh
|
||||
const baseUrl =
|
||||
process.env.BACKEND_URL || `${req.protocol}://${req.get("host")}`;
|
||||
process.env.BACKEND_URL ?? `${req.protocol}://${req.get("host")}`;
|
||||
const processedData = addBaseUrlToImages(termsData, baseUrl);
|
||||
|
||||
res.json({
|
||||
@@ -326,7 +326,7 @@ exports.preview = async (req, res) => {
|
||||
|
||||
// Thêm base URL vào đường dẫn ảnh cho preview
|
||||
const baseUrl =
|
||||
process.env.BACKEND_URL || `${req.protocol}://${req.get("host")}`;
|
||||
process.env.BACKEND_URL ?? `${req.protocol}://${req.get("host")}`;
|
||||
const processedHeroData = addBaseUrlToImages(heroData, baseUrl);
|
||||
|
||||
// Render preview HTML
|
||||
|
||||
Reference in New Issue
Block a user