1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-19 11:39:36 +02:00

Fixed custom icons not updating

This commit is contained in:
unknown 2021-07-28 11:36:48 +02:00
parent f93659b661
commit 1fbe0746a4
6 changed files with 76 additions and 15 deletions

View file

@ -20,7 +20,6 @@ exports.createApp = asyncWrapper(async (req, res, next) => {
_body.icon = req.file.filename;
}
if (pinApps) {
if (parseInt(pinApps.value)) {
app = await App.create({
@ -96,7 +95,13 @@ exports.updateApp = asyncWrapper(async (req, res, next) => {
return next(new ErrorResponse(`App with id of ${req.params.id} was not found`, 404));
}
app = await app.update({ ...req.body });
let _body = { ...req.body };
if (req.file) {
_body.icon = req.file.filename;
}
app = await app.update(_body);
res.status(200).json({
success: true,