mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-18 04:39:14 +00:00
generalise search filter to any enterprise
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
Darkswarm.filter 'hubs', (Matcher)->
|
||||
(hubs, text) ->
|
||||
hubs ||= []
|
||||
text ?= ""
|
||||
|
||||
hubs.filter (hub)=>
|
||||
Matcher.match [
|
||||
hub.name, hub.address.zipcode, hub.address.city, hub.address.state
|
||||
], text
|
||||
@@ -1,6 +0,0 @@
|
||||
Darkswarm.filter 'filterProducers', (hubsFilter)->
|
||||
(producers, text) ->
|
||||
producers ||= []
|
||||
text ?= ""
|
||||
hubsFilter(producers, text)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Darkswarm.filter 'searchEnterprises', (Matcher)->
|
||||
(enterprises, text) ->
|
||||
enterprises ||= []
|
||||
text ?= ""
|
||||
|
||||
enterprises.filter (enterprise)=>
|
||||
Matcher.match [
|
||||
enterprise.name, enterprise.address.zipcode, enterprise.address.city, enterprise.address.state
|
||||
], text
|
||||
Reference in New Issue
Block a user