diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-07-04 20:44:13 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-07-04 20:44:13 +0900 |
| commit | c1b77365a087bb8de0b62813186e819f3f80d7be (patch) | |
| tree | a273422ba7f74f141da57a20f476d1899f19909a /src/client | |
| parent | wip (diff) | |
| download | sharkey-c1b77365a087bb8de0b62813186e819f3f80d7be.tar.gz sharkey-c1b77365a087bb8de0b62813186e819f3f80d7be.tar.bz2 sharkey-c1b77365a087bb8de0b62813186e819f3f80d7be.zip | |
wip
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/desktop/views/pages/search.vue | 15 | ||||
| -rw-r--r-- | src/client/app/mobile/views/pages/search.vue | 15 |
2 files changed, 16 insertions, 14 deletions
diff --git a/src/client/app/desktop/views/pages/search.vue b/src/client/app/desktop/views/pages/search.vue index e79ac1c739..06ea4afbca 100644 --- a/src/client/app/desktop/views/pages/search.vue +++ b/src/client/app/desktop/views/pages/search.vue @@ -19,7 +19,6 @@ <script lang="ts"> import Vue from 'vue'; import Progress from '../../../common/scripts/loading'; -import parse from '../../../common/scripts/parse-search-query'; const limit = 20; @@ -66,10 +65,11 @@ export default Vue.extend({ this.fetching = true; Progress.start(); - (this as any).api('notes/search', Object.assign({ + (this as any).api('notes/search', { limit: limit + 1, - offset: this.offset - }, parse(this.q))).then(notes => { + offset: this.offset, + query: this.q + }).then(notes => { if (notes.length == limit + 1) { notes.pop(); this.existMore = true; @@ -83,10 +83,11 @@ export default Vue.extend({ if (this.moreFetching || this.fetching || this.notes.length == 0 || !this.existMore) return; this.offset += limit; this.moreFetching = true; - return (this as any).api('notes/search', Object.assign({ + return (this as any).api('notes/search', { limit: limit + 1, - offset: this.offset - }, parse(this.q))).then(notes => { + offset: this.offset, + query: this.q + }).then(notes => { if (notes.length == limit + 1) { notes.pop(); } else { diff --git a/src/client/app/mobile/views/pages/search.vue b/src/client/app/mobile/views/pages/search.vue index 9850fbcfb4..6b7c141bff 100644 --- a/src/client/app/mobile/views/pages/search.vue +++ b/src/client/app/mobile/views/pages/search.vue @@ -16,7 +16,6 @@ <script lang="ts"> import Vue from 'vue'; import Progress from '../../../common/scripts/loading'; -import parse from '../../../common/scripts/parse-search-query'; const limit = 20; @@ -47,9 +46,10 @@ export default Vue.extend({ this.fetching = true; Progress.start(); - (this as any).api('notes/search', Object.assign({ - limit: limit + 1 - }, parse(this.q))).then(notes => { + (this as any).api('notes/search', { + limit: limit + 1, + query: this.q + }).then(notes => { if (notes.length == limit + 1) { notes.pop(); this.existMore = true; @@ -61,10 +61,11 @@ export default Vue.extend({ }, more() { this.offset += limit; - (this as any).api('notes/search', Object.assign({ + (this as any).api('notes/search', { limit: limit + 1, - offset: this.offset - }, parse(this.q))).then(notes => { + offset: this.offset, + query: this.q + }).then(notes => { if (notes.length == limit + 1) { notes.pop(); } else { |