Compare commits
8 Commits
fd07373d43
...
fix/48-pro
Author | SHA1 | Date | |
---|---|---|---|
3ea7eb48b4
|
|||
8c8021bedc | |||
46fcaa2db6
|
|||
2d700c77dc
|
|||
c1d78fa8c1
|
|||
7c8a1bb423
|
|||
8e42c7fdbe | |||
c25639b40c |
@ -54,17 +54,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
onError({commit}) {
|
onError({commit, dispatch}) {
|
||||||
commit('setError')
|
commit('setError')
|
||||||
commit('clearProfileId')
|
dispatch('clear')
|
||||||
commit('clearProfile')
|
|
||||||
commit('setNotLoading')
|
|
||||||
commit('hideSpinner')
|
|
||||||
},
|
},
|
||||||
onNotFound({commit, dispatch}) {
|
onNotFound({commit, dispatch}) {
|
||||||
dispatch('onError')
|
dispatch('onError')
|
||||||
commit('setNotFound', true)
|
commit('setNotFound', true)
|
||||||
},
|
},
|
||||||
|
clear({commit}) {
|
||||||
|
commit('clearProfileId')
|
||||||
|
commit('clearProfile')
|
||||||
|
commit('hideSpinner')
|
||||||
|
commit('setNotLoading')
|
||||||
|
},
|
||||||
async load({state, commit, dispatch, rootState}, profileId) {
|
async load({state, commit, dispatch, rootState}, profileId) {
|
||||||
if (state.loading) {
|
if (state.loading) {
|
||||||
return
|
return
|
||||||
@ -111,7 +114,7 @@ export default {
|
|||||||
const responseData = await response.json()
|
const responseData = await response.json()
|
||||||
commit('setProfile', responseData.profile)
|
commit('setProfile', responseData.profile)
|
||||||
commit('hideSpinner')
|
commit('hideSpinner')
|
||||||
commit('setNotSearching')
|
commit('setNotLoading')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
|
this.$router.push({ query: { query: this.searchText }})
|
||||||
this.$store.dispatch('search/search')
|
this.$store.dispatch('search/search')
|
||||||
},
|
},
|
||||||
focusSearchText() {
|
focusSearchText() {
|
||||||
|
@ -112,7 +112,8 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
load: 'profile/load'
|
loadProfile: 'profile/load',
|
||||||
|
clearStore: 'profile/clear',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -126,8 +127,11 @@ export default {
|
|||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
const id = parseInt(this.$route.params.memberId, 10)
|
const id = parseInt(this.$route.params.memberId, 10)
|
||||||
this.load(id)
|
this.loadProfile(id)
|
||||||
}
|
},
|
||||||
|
unmounted() {
|
||||||
|
this.clearStore()
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user