Skip to content

Commit 24e96e5

Browse files
feat: Sort projects on user page by alphabetical order.
1 parent 6212e70 commit 24e96e5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/pages/user/[user].astro

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ const projects = await getUserProjects(userData.id);
2929
const submissions = await getUserSubmissions(userData.id);
3030
const uniqueEvents = new Set();
3131
const events = await getEvents();
32+
33+
projects.sort((a, b) => {
34+
return a.slug.localeCompare(b.slug)
35+
});
36+
3237
for (const submission of submissions) {
3338
uniqueEvents.add(submission.event);
3439
}
@@ -47,6 +52,9 @@ const images = import.meta.glob<{ default: ImageMetadata }>(
4752
"/src/assets/flower/*.{jpeg,jpg,png,gif}",
4853
);
4954
const awards: Award[] = await getUserAwards(userData.id);
55+
awards.sort((a, b) => {
56+
return a.slug.localeCompare(b.slug)
57+
});
5058
5159
const projectToAwardsMap: Map<string, Award[]> = new Map();
5260
for (const submission of submissions) {

0 commit comments

Comments
 (0)