diff --git a/book-racker/src/components/Register.vue b/book-racker/src/components/Register.vue index 0c8cfd02cee84a25bdf2f41205afaa38c7385934..1e9cf88a2fcbb3a0146c3cb3e3b23f5027c1f79c 100644 --- a/book-racker/src/components/Register.vue +++ b/book-racker/src/components/Register.vue @@ -1,3 +1,4 @@ +/* eslint-disable */ <template> <div> <h1>Register</h1> @@ -15,38 +16,30 @@ <script> import AuthentiacationService from '@/services/AuthenticationService' export default { - data () { return { - email:'', - password:'', + email: '', + password: '', error: null } }, - - methods:{ - - async register(){ - try{ - await AuthentiacationService.register({ + methods: { + async register () { + try { + await AuthentiacationService.register({ email: this.email, - password:this.password + password: this.password }) - }catch(error) { - this.error = error.response.data.error - - } - + } catch (error) { + this.error = error.response.data.error + } } } } - </script> <style scoped> - -.error{ - color:red; -} - + .error{ + color:red; + } </style> diff --git a/book-racker/src/services/Api.js b/book-racker/src/services/Api.js index 8c62998d3ff085dd5cb7930c9355f24981c8b792..4719ad81d3ec6ca2f950f113f2ac2f8436cc8603 100644 --- a/book-racker/src/services/Api.js +++ b/book-racker/src/services/Api.js @@ -1,8 +1,7 @@ import axios from 'axios' -export default()=>{ - - return axios.create({ - baseURL:'http://localhost:8081/' - }) +export default() => { + return axios.create({ + baseURL: 'http://localhost:8081/' + }) } diff --git a/book-racker/src/services/AuthenticationService.js b/book-racker/src/services/AuthenticationService.js index b5aba932d5ffa77c5072cbe52e376227d550605d..a09970f624fe0f3697dc233225282c8515c1b5a6 100644 --- a/book-racker/src/services/AuthenticationService.js +++ b/book-racker/src/services/AuthenticationService.js @@ -1,10 +1,7 @@ import Api from '@/services/Api' - +/* eslint-disable no-trailing-spaces */ export default{ - - register(credentials) - { - return Api().post('register' , credentials) - } - -} \ No newline at end of file + register (credentials) { + return Api().post('register', credentials) + } +}