mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Add filter for enterprises within a radius
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
Darkswarm.filter 'distanceWithinKm', ->
|
||||
(enterprises, range) ->
|
||||
enterprises ||= []
|
||||
enterprises.filter (enterprise) ->
|
||||
enterprise.distance / 1000 <= range
|
||||
Reference in New Issue
Block a user