From a92499c29af3c15fc6cb8485501b78c96b6fbb1d Mon Sep 17 00:00:00 2001 From: Ben De Meurichy Date: Thu, 23 May 2024 14:20:23 +0200 Subject: [PATCH] groepen gesorteerd in studentpagina --- frontend/frontend/src/pages/groupsPage/ChooseGroup.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/frontend/src/pages/groupsPage/ChooseGroup.tsx b/frontend/frontend/src/pages/groupsPage/ChooseGroup.tsx index 1e848a98..0c44fba6 100644 --- a/frontend/frontend/src/pages/groupsPage/ChooseGroup.tsx +++ b/frontend/frontend/src/pages/groupsPage/ChooseGroup.tsx @@ -121,10 +121,14 @@ export function ChooseGroup() { } }) } - const groups = await instance.get( + const groups = await instance.get( 'groepen/?project=' + assignmentId ) - setGroups(groups.data) + const sortedGroups = groups.data.sort((a: Group, b: Group) => { + return a.groep_id - b.groep_id + }) + + setGroups(sortedGroups) } catch (err) { console.error(err) } finally {