fix: use productUrl fallback for newly created media items

This commit is contained in:
kihong.kim
2026-02-01 02:41:04 +09:00
parent 0f90a49f32
commit 059cb26b01

View File

@@ -202,7 +202,7 @@ router.post("/upload", upload.single("file"), async (req, res) => {
// 4. Save metadata to local DB
const photo = await Photo.create({
url: `${mediaItem.baseUrl}=w2048-h1024`, // Store the Google Photos URL
url: `${mediaItem.baseUrl || mediaItem.productUrl}=w2048-h1024`, // Store the Google Photos URL
caption: mediaItem.description || "",
active: req.body.active !== "false",
source: "google",