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