mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-24 13:39:35 +02:00
fixes after latest rebase
This commit is contained in:
parent
32bfe33a75
commit
14fbc7e221
2 changed files with 10 additions and 20 deletions
|
@ -16,24 +16,20 @@ exports.createApp = asyncWrapper(async (req, res, next) => {
|
|||
const pinApps = await Config.findOne({
|
||||
where: { key: 'pinAppsByDefault' },
|
||||
});
|
||||
|
||||
|
||||
let app;
|
||||
let _body = { ...req.body };
|
||||
|
||||
let _body = {
|
||||
...req.body,
|
||||
categoryId: parseInt(req.body.categoryId),
|
||||
isPinned: (pinApps && parseInt(pinApps.value)),
|
||||
};
|
||||
|
||||
if (req.file) {
|
||||
_body.icon = req.file.filename;
|
||||
}
|
||||
|
||||
if (pinApps) {
|
||||
if (parseInt(pinApps.value)) {
|
||||
app = await App.create({
|
||||
..._body,
|
||||
isPinned: true,
|
||||
});
|
||||
} else {
|
||||
app = await App.create(req.body);
|
||||
}
|
||||
}
|
||||
app = await App.create(_body);
|
||||
|
||||
res.status(201).json({
|
||||
success: true,
|
||||
|
|
|
@ -10,20 +10,14 @@ const { Sequelize } = require('sequelize');
|
|||
exports.createBookmark = asyncWrapper(async (req, res, next) => {
|
||||
const pinBookmarks = await Config.findOne({
|
||||
where: { key: 'pinBookmarksByDefault' }
|
||||
});
|
||||
});
|
||||
|
||||
let bookmark;
|
||||
let _body = { ...req.body };
|
||||
|
||||
if (req.file) {
|
||||
_body.icon = req.file.filename;
|
||||
}
|
||||
|
||||
|
||||
let _body = {
|
||||
...req.body,
|
||||
categoryId: parseInt(req.body.categoryId),
|
||||
isPinned = (pinBookmarks && parseInt(pinBookmarks.value)),
|
||||
isPinned: (pinBookmarks && parseInt(pinBookmarks.value)),
|
||||
};
|
||||
|
||||
if (req.file) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue