Skip to content

Commit

Permalink
Merge pull request #63 from CityOfPhiladelphia/alphabetize-rco
Browse files Browse the repository at this point in the history
alphabetizes rcos
  • Loading branch information
ajrothwell authored Mar 7, 2025
2 parents af33153 + 8812590 commit b0197d2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/stores/ZoningStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,17 @@ export const useZoningStore = defineStore('ZoningStore', {
const response = await axios.get(url, { params });
if (response.status === 200) {
let data = await response.data;

data.features.sort((a, b) => {
if (a.properties.ORGANIZATION_NAME < b.properties.ORGANIZATION_NAME) {
return -1;
}
if (a.properties.ORGANIZATION_NAME > b.properties.ORGANIZATION_NAME) {
return 1;
}
return 0;
});

data.features.forEach(item => {
item.properties.rco = `<b>${item.properties.ORGANIZATION_NAME}</b><br>${item.properties.ORGANIZATION_ADDRESS}`;
item.properties.contact = `${rcoPrimaryContact(item.properties.PRIMARY_NAME)}<br>${phoneNumber(item.properties.PRIMARY_PHONE)}<br><a target='_blank' href='mailto:${item.properties.PRIMARY_EMAIL}'>${item.properties.PRIMARY_EMAIL}</a>`;
Expand Down

0 comments on commit b0197d2

Please sign in to comment.