Skip to content
Snippets Groups Projects
Commit afb0646b authored by V S Tharunika's avatar V S Tharunika
Browse files

the error will be reflected in the frontend

parent 50cc2361
Branches
No related tags found
No related merge requests found
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
<br> <br>
<input type="password" name="password" v-model="password" placeholder="password"/> <input type="password" name="password" v-model="password" placeholder="password"/>
<br> <br>
<div class="error" v-html ="error"/>
<br>
<button @click="register">Register</button> <button @click="register">Register</button>
</div> </div>
</template> </template>
...@@ -17,18 +19,23 @@ export default { ...@@ -17,18 +19,23 @@ export default {
data () { data () {
return { return {
email:'', email:'',
password:'' password:'',
error: null
} }
}, },
methods:{ methods:{
async register(){ async register(){
try{
await AuthentiacationService.register({ await AuthentiacationService.register({
email: this.email, email: this.email,
password:this.password password:this.password
}) })
}catch(error) {
this.error = error.response.data.error
}
} }
} }
...@@ -38,4 +45,8 @@ export default { ...@@ -38,4 +45,8 @@ export default {
<style scoped> <style scoped>
.error{
color:red;
}
</style> </style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment