pleroma-fe/src/components/user_finder/user_finder.js

23 lines
507 B
JavaScript
Raw Normal View History

2017-05-13 02:54:12 +10:00
const UserFinder = {
data: () => ({
username: undefined,
hidden: true
2017-05-13 02:54:12 +10:00
}),
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}})
}
})
},
toggleHidden () {
this.hidden = !this.hidden
2017-05-13 02:54:12 +10:00
}
}
}
export default UserFinder