mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-07 04:53:12 +08:00
Fixed custom icons not updating
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user