From 1c7cba70ea22ad78374416830fb5708b2962dde6 Mon Sep 17 00:00:00 2001 From: Duy Nguyen Date: Wed, 22 Nov 2023 14:24:51 +0100 Subject: [PATCH] chore: sort topics based on title alphabetically --- blocks/topic-list/topic-list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/topic-list/topic-list.js b/blocks/topic-list/topic-list.js index 3e3ddfdcd..5ac272384 100644 --- a/blocks/topic-list/topic-list.js +++ b/blocks/topic-list/topic-list.js @@ -10,7 +10,7 @@ export async function fetchTopicsForCategory(category) { const topics = await ffetch('/us/en/products-index.json') .filter(({ fullCategory, type }) => fullCategory === category && type === 'Topic') .all(); - return topics.sort((item1, item2) => item2.lastModified - item1.lastModified); + return topics.sort((item1, item2) => item1.title.localeCompare(item2.title)); } export default async function decorate(block) {