Sort Shop locations alphabetically
This commit is contained in:
@@ -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)
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user