From fed3d1171ca6f846c730a6780fed3269a07df0df Mon Sep 17 00:00:00 2001 From: Charles Dufour Date: Thu, 19 Dec 2024 13:46:21 +0100 Subject: [PATCH] [TRELLO-2598] Sort categories for mobile --- mobile-tools/src/controllers/categories.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile-tools/src/controllers/categories.controller.ts b/mobile-tools/src/controllers/categories.controller.ts index c7d45aaac..f0dbab568 100644 --- a/mobile-tools/src/controllers/categories.controller.ts +++ b/mobile-tools/src/controllers/categories.controller.ts @@ -10,7 +10,7 @@ const CategoriesController = Router() CategoriesController.get('/', async (req: Request<{}, {}, {}, QueryParams>, res, next) => { try { const lang = req.query.lang ?? 'fr' - return res.status(200).send(categories[lang]) + return res.status(200).send(categories[lang].sort((a, b) => Number(a.id) - Number(b.id))) } catch (err) { next(err) }