mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Moving taxons into its own module, adding preferred shopfront taxon order to enterprise
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
angular.module("ofn.admin").factory "Taxons", (taxons, $filter) ->
|
||||
new class Taxons
|
||||
constructor: ->
|
||||
@taxons = taxons
|
||||
|
||||
# For finding a single Taxon
|
||||
findByID: (id) ->
|
||||
$filter('filter')(@taxons, {id: id}, true)[0]
|
||||
|
||||
# For finding multiple Taxons represented by comma delimited string
|
||||
findByIDs: (ids) ->
|
||||
taxon for taxon in @taxons when taxon.id.toString() in ids.split(",")
|
||||
|
||||
findByTerm: (term) ->
|
||||
$filter('filter')(@taxons, term)
|
||||
Reference in New Issue
Block a user