Skip to content

Commit

Permalink
bring back countries
Browse files Browse the repository at this point in the history
  • Loading branch information
xlcrr committed Sep 26, 2024
1 parent 319d64c commit 149f5f1
Showing 1 changed file with 31 additions and 32 deletions.
63 changes: 31 additions & 32 deletions resources/js/views/Locations/SortLocations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</template>

<script>
// import sortBy from 'lodash.sortby'
import sortBy from 'lodash.sortby'
import LocationNavbar from '../../components/Locations/LocationNavBar.vue'
// import LocationMetadata from '../../components/Locations/LocationMetadata.vue'
Expand Down Expand Up @@ -139,37 +139,36 @@ export default {
*/
orderedBy ()
{
return this.locations;
// if (this.sortedBy === "alphabetical")
// {
// return this.locations;
// }
// else if (this.sortedBy === 'most-data')
// {
// return sortBy(this.locations, 'total_litter_redis').reverse();
// }
// else if (this.sortedBy === 'most-data-per-person')
// {
// return sortBy(this.locations, 'avg_litter_per_user').reverse();
// }
// else if (this.sortedBy === 'most-recently-updated')
// {
// return sortBy(this.locations, 'updated_at').reverse();
// }
// else if (this.sortedBy === 'total-contributors')
// {
// return sortBy(this.locations, 'total_contributors_redis').reverse();
// }
// else if (this.sortedBy === 'first-created')
// {
// return sortBy(this.locations, 'created_at');
// }
// else if (this.sortedBy === 'most-recently-created')
// {
// return sortBy(this.locations, 'created_at').reverse();
// }
//
// return [];
if (this.sortedBy === "alphabetical")
{
return this.locations;
}
else if (this.sortedBy === 'most-data')
{
return sortBy(this.locations, 'total_litter_redis').reverse();
}
else if (this.sortedBy === 'most-data-per-person')
{
return sortBy(this.locations, 'avg_litter_per_user').reverse();
}
else if (this.sortedBy === 'most-recently-updated')
{
return sortBy(this.locations, 'updated_at').reverse();
}
else if (this.sortedBy === 'total-contributors')
{
return sortBy(this.locations, 'total_contributors_redis').reverse();
}
else if (this.sortedBy === 'first-created')
{
return sortBy(this.locations, 'created_at');
}
else if (this.sortedBy === 'most-recently-created')
{
return sortBy(this.locations, 'created_at').reverse();
}
return [];
},
/**
Expand Down

0 comments on commit 149f5f1

Please sign in to comment.