fix: actually write image
This commit is contained in:
@@ -52,7 +52,7 @@ async function processCreateArticle(
|
||||
let finalPath = result.image;
|
||||
if (result?.image) {
|
||||
const extension = fileExtension(result?.image);
|
||||
const imagePath = `resources/articles/images/${
|
||||
const imagePath = `articles/images/${
|
||||
safeFileName(title)
|
||||
}_cover.${extension}`;
|
||||
try {
|
||||
@@ -63,7 +63,7 @@ async function processCreateArticle(
|
||||
await createResource(imagePath, buffer);
|
||||
finalPath = imagePath;
|
||||
} catch (err) {
|
||||
console.log("Failed to save image", err);
|
||||
console.log(`Failed to save image: ${result.image}`, err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user