Add user finder.

This commit is contained in:
Roger Braun 2017-05-12 18:54:12 +02:00
parent 1f8d303863
commit 2ec7069b3c
6 changed files with 49 additions and 3 deletions

View file

@ -0,0 +1,18 @@
const UserFinder = {
data: () => ({
username: undefined
}),
methods: {
findUser (username) {
this.$store.state.api.backendInteractor.externalProfile(username)
.then((user) => {
if (!user.error) {
this.$store.commit('addNewUsers', [user])
this.$router.push({name: 'user-profile', params: {id: user.id}})
}
})
}
}
}
export default UserFinder