فهرست منبع

Add order by updated

sbkwgh 8 سال پیش
والد
کامیت
3fe9a4cfe0
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      routes/category.js

+ 2 - 1
routes/category.js

@@ -8,7 +8,8 @@ router.get('/', async (req, res) => {
 	try {
 		let categories = await Category.findAll({
 			attributes: { exclude: ['id'] },
-			include: Category.includeOptions(1)
+			include: Category.includeOptions(1),
+			order: ['updatedAt', 'DESC']
 		})
 
 		res.json(categories)