mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Move user queries to graphql/User.js
This commit is contained in:
parent
e544725e87
commit
3f4e717163
@ -29,8 +29,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import gql from 'graphql-tag'
|
||||
import HcEditor from '~/components/Editor/Editor'
|
||||
import { minimisedUserQuery } from '~/graphql/User'
|
||||
import PostQuery from '~/graphql/PostQuery'
|
||||
import CommentMutations from '~/graphql/CommentMutations'
|
||||
|
||||
@ -97,16 +97,7 @@ export default {
|
||||
apollo: {
|
||||
User: {
|
||||
query() {
|
||||
return gql`
|
||||
{
|
||||
User(orderBy: slug_asc) {
|
||||
id
|
||||
slug
|
||||
name
|
||||
avatar
|
||||
}
|
||||
}
|
||||
`
|
||||
return minimisedUserQuery()
|
||||
},
|
||||
result(result) {
|
||||
this.users = result.data.User
|
||||
|
||||
@ -8,19 +8,14 @@
|
||||
<ds-flex :gutter="{ base: 'small', md: 'small', sm: 'x-large', xs: 'x-large' }">
|
||||
<ds-flex-item :width="{ base: '0%', md: '50%', sm: '0%', xs: '0%' }" />
|
||||
<ds-flex-item :width="{ base: '40%', md: '20%', sm: '30%', xs: '30%' }">
|
||||
<ds-button
|
||||
ghost
|
||||
class="cancelBtn"
|
||||
@click.prevent="closeEditWindow"
|
||||
>{{ $t('actions.cancel') }}</ds-button>
|
||||
<ds-button ghost class="cancelBtn" @click.prevent="closeEditWindow">
|
||||
{{ $t('actions.cancel') }}
|
||||
</ds-button>
|
||||
</ds-flex-item>
|
||||
<ds-flex-item :width="{ base: '40%', md: '20%', sm: '40%', xs: '40%' }">
|
||||
<ds-button
|
||||
type="submit"
|
||||
:loading="loading"
|
||||
:disabled="disabled || errors"
|
||||
primary
|
||||
>{{ $t('post.comment.submit') }}</ds-button>
|
||||
<ds-button type="submit" :loading="loading" :disabled="disabled || errors" primary>
|
||||
{{ $t('post.comment.submit') }}
|
||||
</ds-button>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
</ds-card>
|
||||
@ -29,8 +24,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import gql from 'graphql-tag'
|
||||
import HcEditor from '~/components/Editor/Editor'
|
||||
import { minimisedUserQuery } from '~/graphql/User'
|
||||
import CommentMutations from '~/graphql/CommentMutations.js'
|
||||
|
||||
export default {
|
||||
@ -90,14 +85,7 @@ export default {
|
||||
apollo: {
|
||||
User: {
|
||||
query() {
|
||||
return gql`
|
||||
{
|
||||
User(orderBy: slug_asc) {
|
||||
id
|
||||
slug
|
||||
}
|
||||
}
|
||||
`
|
||||
return minimisedUserQuery()
|
||||
},
|
||||
result({ data: { User } }) {
|
||||
this.users = User
|
||||
|
||||
@ -77,6 +77,19 @@ export default i18n => {
|
||||
`
|
||||
}
|
||||
|
||||
export const minimisedUserQuery = () => {
|
||||
return gql`
|
||||
query {
|
||||
User(orderBy: slug_asc) {
|
||||
id
|
||||
slug
|
||||
name
|
||||
avatar
|
||||
}
|
||||
}
|
||||
`
|
||||
}
|
||||
|
||||
export const notificationQuery = i18n => {
|
||||
const lang = i18n.locale().toUpperCase()
|
||||
return gql`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user