merge commit

This commit is contained in:
2026-04-11 19:19:09 +07:00
12 changed files with 25 additions and 26 deletions

View File

@@ -445,10 +445,9 @@ exports.apiGetBlogs = async (req, res) => {
};
exports.api = async (req, res) => {
try {
// Chỉ dùng doc mới nhất, không merge nhiều docs
const doc = await getHomeDoc();
let data = doc?.toObject() || {};
const baseUrl = `${req.protocol}://${req.get("host")}`;
let data = await getHomeData();
const baseUrl =
process.env.BACKEND_URL ?? `${req.protocol}://${req.get("host")}`;
// === Xử lý Blog Preview động ===
const blogPreview = data.blogPreview || {};