mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-03 02:21:33 +00:00
Initialise user autocomplete element using data from element itself rather than AJAX request
This commit is contained in:
@@ -4,8 +4,7 @@ angular.module("admin.users").directive "ofnUserAutocomplete", ($http) ->
|
||||
element.select2
|
||||
multiple: false
|
||||
initSelection: (element, callback) ->
|
||||
$http.get( Spree.url(Spree.routes.user_search, { ids: element.val() }) ).success (data) ->
|
||||
callback(data[0]) if data.length > 0
|
||||
callback { id: element.val(), email: attrs.email }
|
||||
ajax:
|
||||
url: Spree.routes.user_search
|
||||
datatype: 'json'
|
||||
|
||||
Reference in New Issue
Block a user