chore: switch to apollo-composable
This commit is contained in:
@@ -69,8 +69,8 @@ import {
|
||||
} from '~/utils/graph-client'
|
||||
|
||||
import List from './List'
|
||||
import { useMutation, useQuery, useResult } from '../../../plugins/apollo'
|
||||
import useAuth from '../../../plugins/auth'
|
||||
import { useMutation, useQuery, useResult } from '@vue/apollo-composable'
|
||||
import { useAuth } from '../../../plugins/auth'
|
||||
import { useTranslation } from '../../../plugins/i18n'
|
||||
|
||||
export default {
|
||||
@@ -82,18 +82,18 @@ export default {
|
||||
const { t } = useTranslation()
|
||||
setTitle(t('app.links.filters'))
|
||||
const { isAuthenticated } = useAuth()
|
||||
const { data, loading, refetch } = useQuery(fetchFilters)
|
||||
const { result: data, loading, refetch } = useQuery(fetchFilters)
|
||||
const bands = useResult(data, [], result => result.bands)
|
||||
const cities = useResult(data, [], result => result.cities)
|
||||
const danceHalls = useResult(data, [], result => result.danceHalls)
|
||||
const municipalities = useResult(data, [], result => result.municipalities)
|
||||
const states = useResult(data, [], result => result.states)
|
||||
const snackbar = ref({ active: false, color: 'success', text: '' })
|
||||
const [doToggleIgnoreBand] = useMutation(toggleIgnoreBand)
|
||||
const [doToggleIgnoreDanceHall] = useMutation(toggleIgnoreDanceHall)
|
||||
const [doToggleIgnoreCity] = useMutation(toggleIgnoreCity)
|
||||
const [doToggleIgnoreMunicipality] = useMutation(toggleIgnoreMunicipality)
|
||||
const [doToggleIgnoreState] = useMutation(toggleIgnoreState)
|
||||
const {mutate: doToggleIgnoreBand} = useMutation(toggleIgnoreBand)
|
||||
const {mutate: doToggleIgnoreDanceHall} = useMutation(toggleIgnoreDanceHall)
|
||||
const {mutate: doToggleIgnoreCity} = useMutation(toggleIgnoreCity)
|
||||
const {mutate: doToggleIgnoreMunicipality} = useMutation(toggleIgnoreMunicipality)
|
||||
const {mutate: doToggleIgnoreState} = useMutation(toggleIgnoreState)
|
||||
|
||||
const toggleIgnoreSuccess = name => {
|
||||
return () => {
|
||||
@@ -115,27 +115,27 @@ export default {
|
||||
const toggleIgnore = (type, name) => {
|
||||
switch (type) {
|
||||
case 'band':
|
||||
doToggleIgnoreBand({ variables: { name } })
|
||||
doToggleIgnoreBand({ name })
|
||||
.then(toggleIgnoreSuccess(name))
|
||||
.catch(toggleIgnoreFailed)
|
||||
break
|
||||
case 'danceHall':
|
||||
doToggleIgnoreDanceHall({ variables: { name } })
|
||||
doToggleIgnoreDanceHall({ name })
|
||||
.then(toggleIgnoreSuccess(name))
|
||||
.catch(toggleIgnoreFailed)
|
||||
break
|
||||
case 'city':
|
||||
doToggleIgnoreCity({ variables: { name } })
|
||||
doToggleIgnoreCity({ name })
|
||||
.then(toggleIgnoreSuccess(name))
|
||||
.catch(toggleIgnoreFailed)
|
||||
break
|
||||
case 'municipality':
|
||||
doToggleIgnoreMunicipality({ variables: { name } })
|
||||
doToggleIgnoreMunicipality({ name })
|
||||
.then(toggleIgnoreSuccess(name))
|
||||
.catch(toggleIgnoreFailed)
|
||||
break
|
||||
case 'state':
|
||||
doToggleIgnoreState({ variables: { name } })
|
||||
doToggleIgnoreState({ name })
|
||||
.then(toggleIgnoreSuccess(name))
|
||||
.catch(toggleIgnoreFailed)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user