Skip to content

Commit 9f8aeff

Browse files
committed
Fix: Removed limit On Filteration
1 parent de2deba commit 9f8aeff

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

app/pods/questions/index/controller.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,24 @@ export default Controller.extend({
88
searchString: '',
99
searchTask: task(function * () {
1010
yield timeout(250)
11+
12+
let searchStr = this.get('searchString').trim()
13+
let pageOpts = {}
14+
this.set('searchString', searchStr)
15+
16+
if(searchStr === '') {
17+
pageOpts = {
18+
number: 1,
19+
limit: this.get('limit')
20+
}
21+
} else {
22+
pageOpts = {
23+
number: 1
24+
}
25+
}
1126
const questions = yield this.get('store').query('question', {
1227
include: 'user',
13-
page: {
14-
number: this.get('page'),
15-
limit: this.get('limit')
16-
},
28+
page: pageOpts,
1729
filter: {
1830
title: {
1931
$iLike: `%${this.get('searchString')}%`

0 commit comments

Comments
 (0)