Sort Shop locations alphabetically
This commit is contained in:
@@ -7,7 +7,11 @@
|
|||||||
const { locations, shop } = getContext('global')
|
const { locations, shop } = getContext('global')
|
||||||
|
|
||||||
const locationsWithPoster = locations
|
const locationsWithPoster = locations
|
||||||
|
// Filter locations with posters only
|
||||||
.filter((loc: any) => loc.has_poster)
|
.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)
|
.map((loc: any) => loc.name)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user