Skip to content

Commit

Permalink
Update register form
Browse files Browse the repository at this point in the history
  • Loading branch information
Zipofar Ago committed Aug 15, 2019
1 parent 9152e7b commit 38f7126
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/components/RegistrationForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<input v-model="login" placeholder="Login">
<input type="password" v-model="password" placeholder="Password">
<button v-on:click="makeReg">Register</button>
<p v-if="errorMsg">{{ errorMsg }}</p>
</div>
</template>

Expand All @@ -19,10 +20,12 @@ export default {
password: '',
user: {},
token: '',
errorMsg: '',
};
},
methods: {
makeReg: function () {
this.errorMsg = '';
axios({
method: 'post',
baseURL: apiBaseUrl,
Expand All @@ -36,7 +39,9 @@ export default {
this.user = res.data.data.user;
this.token = res.data.data.token;
})
.catch((err) => { console.log(err) })
.catch((err) => {
this.errorMsg = err.response.data.message;
})
},
},
}
Expand Down

0 comments on commit 38f7126

Please sign in to comment.