Compare commits

..

4 Commits

Author SHA1 Message Date
fd07373d43 implement profile view
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-10-03 17:56:52 +02:00
e6e44d5de8 redirect users with token #38 2021-09-24 17:51:37 +02:00
c3cc51dbf9 implement seach view autofocus #41 2021-09-24 17:45:11 +02:00
9906e32f45 add login page name field autofocus #42 2021-09-24 17:39:24 +02:00
3 changed files with 9 additions and 17 deletions

View File

@ -54,20 +54,17 @@ export default {
} }
}, },
actions: { actions: {
onError({commit, dispatch}) { onError({commit}) {
commit('setError') commit('setError')
dispatch('clear') commit('clearProfileId')
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
@ -114,7 +111,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('setNotLoading') commit('setNotSearching')
} }
} }
} }

View File

@ -109,7 +109,6 @@ 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() {

View File

@ -112,8 +112,7 @@ export default {
}, },
methods: { methods: {
...mapActions({ ...mapActions({
loadProfile: 'profile/load', load: 'profile/load'
clearStore: 'profile/clear',
}) })
}, },
computed: { computed: {
@ -127,11 +126,8 @@ export default {
}, },
async created() { async created() {
const id = parseInt(this.$route.params.memberId, 10) const id = parseInt(this.$route.params.memberId, 10)
this.loadProfile(id) this.load(id)
}, }
unmounted() {
this.clearStore()
},
}; };
</script> </script>