mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-24 13:39:35 +02:00
Fixed bug with alphabetical order not working for bookmarks. Minor changes related to bookmarks form
This commit is contained in:
parent
ec5f50aba4
commit
d5610ad6be
12 changed files with 89 additions and 17 deletions
|
@ -18,8 +18,14 @@ const getAllCategories = asyncWrapper(async (req, res, next) => {
|
|||
|
||||
const order =
|
||||
orderType == 'name'
|
||||
? [[Sequelize.fn('lower', Sequelize.col('bookmarks.name')), 'ASC']]
|
||||
: [[{ model: Bookmark, as: 'bookmarks' }, orderType, 'ASC']];
|
||||
? [
|
||||
[Sequelize.fn('lower', Sequelize.col('Category.name')), 'ASC'],
|
||||
[Sequelize.fn('lower', Sequelize.col('bookmarks.name')), 'ASC'],
|
||||
]
|
||||
: [
|
||||
[orderType, 'ASC'],
|
||||
[{ model: Bookmark, as: 'bookmarks' }, orderType, 'ASC'],
|
||||
];
|
||||
|
||||
categories = categories = await Category.findAll({
|
||||
include: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue