26 lines
656 B
CoffeeScript
26 lines
656 B
CoffeeScript
import PagedRemoteArray from 'ember-cli-pagination/remote/paged-remote-array'
|
|
|
|
export default PagedRemoteArray.extend
|
|
a: 42
|
|
#params: {}
|
|
filters: {}
|
|
init: ->
|
|
query = @get('filters')?.toProperties() || {}
|
|
@otherParams ||= {}
|
|
@otherParams['q'] = query
|
|
#@setOtherParam('q', query) # explicitly not, init does not trigger operational callbacks
|
|
@_super arguments...
|
|
|
|
reload: ->
|
|
query = @get('filters')?.toProperties() || {}
|
|
@incrementProperty('filters.filter_calls')
|
|
@set 'page', 1
|
|
@set 'lastPage', null
|
|
@setOtherParam('q', query)
|
|
|
|
paramMapping:
|
|
total_pages: 'total-pages'
|
|
total_count: 'total-count'
|
|
|
|
|