fix: use productUrl fallback for newly created media items
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user