mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-12-22 15:49:08 +03:00
fix for avatars
This commit is contained in:
parent
ccd04139ba
commit
9598813e66
1 changed files with 1 additions and 1 deletions
|
@ -95,7 +95,7 @@ app.post("/:id/avatar", upload.single('avatar'), async (req, res) => {
|
|||
if (req.user.id !== member.id && !req.user.admin) return res.error(403, "You have not got permission for this.");
|
||||
|
||||
if (!req.file) return res.error(400, "Missing avatar in request body.");
|
||||
member.avatar = req.file.destination.slice("./public".length) + "/" + req.file.filename;
|
||||
member.avatar = "/images/avatars/" + req.file.filename;
|
||||
res.complate(await member.save());
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue