mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-22 00:57:26 +00:00
Adding quick search and column dropdown to customers index
This commit is contained in:
@@ -1 +1 @@
|
||||
angular.module("admin.customers", ['ngResource', 'admin.indexUtils'])
|
||||
angular.module("admin.customers", ['ngResource', 'admin.indexUtils', 'admin.dropdown'])
|
||||
@@ -1,12 +1,14 @@
|
||||
angular.module("admin.customers").factory 'Customers', (CustomerResource) ->
|
||||
new class Customers
|
||||
customers: {}
|
||||
customers: []
|
||||
customers_by_id: {}
|
||||
loaded: false
|
||||
|
||||
index: (params={}, callback=null) ->
|
||||
CustomerResource.index params, (data) =>
|
||||
for customer in data
|
||||
@customers[customer.id] = customer
|
||||
@customers.push customer
|
||||
@customers_by_id[customer.id] = customer
|
||||
|
||||
@loaded = true
|
||||
(callback || angular.noop)(@customers)
|
||||
|
||||
Reference in New Issue
Block a user