diff --git a/public/articleImages/2.png b/public/articleImages/2.png index 4caf5bf..13a80aa 100644 Binary files a/public/articleImages/2.png and b/public/articleImages/2.png differ diff --git a/routes/edit.post.js b/routes/edit.post.js index dba4819..f71b8a8 100644 --- a/routes/edit.post.js +++ b/routes/edit.post.js @@ -2,7 +2,6 @@ const Article = require('../modules/article') const ifs = require('../modules/imagefs') -const Image = require('../modules/image') const editPost = async(ctx, dbName) => { try { @@ -13,10 +12,8 @@ const editPost = async(ctx, dbName) => { const article = await new Article(dbName) await article.reupload(id, body.title, body.summary, body.content, body.tag) const {path, type} = ctx.request.files.image - const image = await new Image(dbName) await ifs.deletePicture(`public/articleImages/${id}.png`) await ifs.uploadPicture(path, type, `${id}`, 'public/articleImages/' ) - await image.replace(`public/articleImages/${id}.png`) ctx.redirect(`/?msg=new "${body.title}" uploaded`) } catch(err) { await ctx.render('error', {message: err.message})