|
|
|
@ -1,6 +1,5 @@ |
|
|
|
|
import $ from 'jquery' |
|
|
|
|
import _ from 'lodash' |
|
|
|
|
import URI from 'urijs' |
|
|
|
|
import humps from 'humps' |
|
|
|
|
import { subscribeChannel } from '../../socket' |
|
|
|
|
import { connectElements } from '../../lib/redux_helpers.js' |
|
|
|
@ -28,12 +27,12 @@ export function reducer (state, action) { |
|
|
|
|
const elements = { |
|
|
|
|
'[data-search-field]': { |
|
|
|
|
render ($el, state) { |
|
|
|
|
$el |
|
|
|
|
return $el |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
'[data-search-button]': { |
|
|
|
|
render ($el, state) { |
|
|
|
|
$el |
|
|
|
|
return $el |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
'[data-cancel-search-button]': { |
|
|
|
@ -62,8 +61,8 @@ if ($('[data-page="address-logs"]').length) { |
|
|
|
|
store.dispatch({ |
|
|
|
|
type: 'START_SEARCH', |
|
|
|
|
addressHash: addressHash}) |
|
|
|
|
var topic = $('[data-search-field]').val(); |
|
|
|
|
var path = "/search_logs?topic=" + topic + "&address_id=" + store.getState().addressHash |
|
|
|
|
var topic = $('[data-search-field]').val() |
|
|
|
|
var path = '/search_logs?topic=' + topic + '&address_id=' + store.getState().addressHash |
|
|
|
|
store.dispatch({type: 'START_REQUEST'}) |
|
|
|
|
$.getJSON(path, {type: 'JSON'}) |
|
|
|
|
.done(response => store.dispatch(Object.assign({type: 'ITEMS_FETCHED'}, humps.camelizeKeys(response)))) |
|
|
|
|