mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-25 22:09:36 +02:00
fixes after latest rebase
This commit is contained in:
parent
32bfe33a75
commit
14fbc7e221
2 changed files with 10 additions and 20 deletions
|
@ -18,22 +18,18 @@ exports.createApp = asyncWrapper(async (req, res, next) => {
|
|||
});
|
||||
|
||||
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,
|
||||
|
|
|
@ -13,17 +13,11 @@ exports.createBookmark = asyncWrapper(async (req, res, next) => {
|
|||
});
|
||||
|
||||
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