aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_finder/user_finder.js
blob: a6bf08b66520e65ce448c8bdf5c6d240bcf1224d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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