mirror of
https://github.com/pawelmalak/flame.git
synced 2026-02-28 09:23:12 +08:00
Trim icon name. Filter private bookmarks if user is not authenticated
This commit is contained in:
@@ -12,6 +12,10 @@ const createBookmark = asyncWrapper(async (req, res, next) => {
|
||||
categoryId: parseInt(req.body.categoryId),
|
||||
};
|
||||
|
||||
if (_body.icon) {
|
||||
_body.icon = _body.icon.trim();
|
||||
}
|
||||
|
||||
if (req.file) {
|
||||
_body.icon = req.file.filename;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@ const updateBookmark = asyncWrapper(async (req, res, next) => {
|
||||
categoryId: parseInt(req.body.categoryId),
|
||||
};
|
||||
|
||||
if (_body.icon) {
|
||||
_body.icon = _body.icon.trim();
|
||||
}
|
||||
|
||||
if (req.file) {
|
||||
_body.icon = req.file.filename;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user