From c1b77365a087bb8de0b62813186e819f3f80d7be Mon Sep 17 00:00:00 2001 From: syuilo <syuilotan@yahoo.co.jp> Date: Wed, 4 Jul 2018 20:44:13 +0900 Subject: [PATCH] wip --- src/client/app/desktop/views/pages/search.vue | 15 ++++++++------- 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 {