diff options
| author | Shpuld Shpuldson <shpuld@gmail.com> | 2017-05-31 11:58:32 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shpuld@gmail.com> | 2017-05-31 11:58:32 +0300 |
| commit | 1b79ae09e024152555d01b78a5bb7bb615f5155c (patch) | |
| tree | 2853e73f8a18df6323ac2dafc8cceca67d79d854 /src/components/user_finder/user_finder.js | |
| parent | 5ad4d043e7514a26a395cf72215a74362c4ca2e0 (diff) | |
| parent | d389d3a7633f88933586b9660b4ad3510b7f98ee (diff) | |
Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma-fe into feature/notification-improvements
Diffstat (limited to 'src/components/user_finder/user_finder.js')
| -rw-r--r-- | src/components/user_finder/user_finder.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/components/user_finder/user_finder.js b/src/components/user_finder/user_finder.js new file mode 100644 index 00000000..a6bf08b6 --- /dev/null +++ b/src/components/user_finder/user_finder.js @@ -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 |
