From 7e29caf2c27953ae2fc60270a2aa0b5aab8eb231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Sun, 21 Nov 2021 13:50:44 +0100 Subject: [PATCH] Sort Shop locations alphabetically --- src/components/organisms/Shop.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/organisms/Shop.svelte b/src/components/organisms/Shop.svelte index 7458e92..b8cef0e 100644 --- a/src/components/organisms/Shop.svelte +++ b/src/components/organisms/Shop.svelte @@ -7,7 +7,11 @@ const { locations, shop } = getContext('global') const locationsWithPoster = locations + // Filter locations with posters only .filter((loc: any) => loc.has_poster) + // Sort locations alphabetically from slug (a>z) + .sort((a: any, b: any) => a.slug.localeCompare(b.slug)) + // Return name only .map((loc: any) => loc.name)