mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-11 22:54:46 +08:00
Fixed bug with custom icons not working with apps
This commit is contained in:
@@ -7,20 +7,20 @@ const Bookmark = require('../../models/Bookmark');
|
||||
const createBookmark = asyncWrapper(async (req, res, next) => {
|
||||
let bookmark;
|
||||
|
||||
let _body = {
|
||||
let body = {
|
||||
...req.body,
|
||||
categoryId: parseInt(req.body.categoryId),
|
||||
};
|
||||
|
||||
if (_body.icon) {
|
||||
_body.icon = _body.icon.trim();
|
||||
if (body.icon) {
|
||||
body.icon = body.icon.trim();
|
||||
}
|
||||
|
||||
if (req.file) {
|
||||
_body.icon = req.file.filename;
|
||||
body.icon = req.file.filename;
|
||||
}
|
||||
|
||||
bookmark = await Bookmark.create(_body);
|
||||
bookmark = await Bookmark.create(body);
|
||||
|
||||
res.status(201).json({
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user