change || to ??

This commit is contained in:
2026-04-13 14:39:00 +07:00
parent fb64059193
commit 50332f2548
2 changed files with 2 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
*/
function addBaseUrlToImages(data, baseUrl) {
// Use passed baseUrl, then env var, then default to localhost:3001
const BACKEND_URL = (baseUrl || process.env.BACKEND_URL || "http://localhost:3001").replace(/\/$/, "");
const BACKEND_URL = (baseUrl ?? process.env.BACKEND_URL ?? "http://localhost:3001").replace(/\/$/, "");
// Tạo bản sao sâu để tránh thay đổi dữ liệu gốc
const processedData = JSON.parse(JSON.stringify(data));