From fdc0d808f69a36f2fbfd8086fe26153ae0db6d57 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Fri, 16 Aug 2019 14:18:18 +0200 Subject: [PATCH] Fix search query --- webapp/graphql/settings/BlockedUsers.js | 36 ++++++++++++++----------- webapp/pages/profile/_id/_slug.vue | 3 +-- webapp/store/search.js | 7 +++-- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/webapp/graphql/settings/BlockedUsers.js b/webapp/graphql/settings/BlockedUsers.js index e47355b18..8f882f8ad 100644 --- a/webapp/graphql/settings/BlockedUsers.js +++ b/webapp/graphql/settings/BlockedUsers.js @@ -1,7 +1,7 @@ import gql from 'graphql-tag' export const BlockedUsers = () => { - return gql(` + return gql` { blockedUsers { id @@ -13,27 +13,31 @@ export const BlockedUsers = () => { deleted } } - `) + ` } export const Block = () => { - return gql(`mutation($id:ID!) { - block(id: $id) { - id - name - isBlocked - followedByCurrentUser + return gql` + mutation($id: ID!) { + block(id: $id) { + id + name + isBlocked + followedByCurrentUser + } } - }`) + ` } export const Unblock = () => { - return gql(`mutation($id:ID!) { - unblock(id: $id) { - id - name - isBlocked - followedByCurrentUser + return gql` + mutation($id: ID!) { + unblock(id: $id) { + id + name + isBlocked + followedByCurrentUser + } } - }`) + ` } diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index 2d4090aab..6e4baba4d 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -255,9 +255,8 @@ import ContentMenu from '~/components/ContentMenu' import HcUpload from '~/components/Upload' import HcAvatar from '~/components/Avatar/Avatar.vue' import { filterPosts } from '~/graphql/PostQuery' -// import PostQuery from '~/graphql/UserProfile/Post.js' import UserQuery from '~/graphql/User' -import { Block, Unblock } from '~/graphql/settings/BlockedUsers.js' +import { Block, Unblock } from '~/graphql/settings/BlockedUsers' const tabToFilterMapping = ({ tab, id }) => { return { diff --git a/webapp/store/search.js b/webapp/store/search.js index bae9bc249..0d0172a98 100644 --- a/webapp/store/search.js +++ b/webapp/store/search.js @@ -45,15 +45,14 @@ export const actions = { commit('SET_QUICK_PENDING', true) await this.app.apolloProvider.defaultClient .query({ - query: gql(` + query: gql` query findPosts($query: String!) { findPosts(query: $query, limit: 10) { id slug label: title - value: title, + value: title shoutedCount - commentedCount createdAt author { id @@ -62,7 +61,7 @@ export const actions = { } } } - `), + `, variables: { query: value.replace(/\s/g, '~ ') + '~', },