Changeset a520992
- Timestamp:
- 01/24/25 20:08:37 (3 months ago)
- Branches:
- master
- Children:
- 17bf12d
- Parents:
- 17db9d2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ReserveNGo-frontend/src/components/Project/register_.vue
r17db9d2 ra520992 7 7 path: '', 8 8 url: 'http://localhost:8080/api/auth/register/', 9 form_info:{ 10 firstName: '', 11 lastName: '', 12 email: '', 13 password: '', 14 phoneNumber: '', 15 16 }, 17 data: {} 9 18 10 19 } … … 12 21 13 22 methods: { 23 register() { 24 fetch(this.url+this.path, { 25 method: 'POST', 26 headers: { "Content-Type": "application/json" }, 27 body: JSON.stringify({firstName: this.firstName, lastName: this.lastName, email: this.email, password: this.password}) 28 }).then((response) => {response.json()}) 29 .then((json) => this.data = json) 30 31 } 14 32 15 33 }, … … 33 51 34 52 <div class="col-3"> 35 <form v-bind:action="url+path" method="POST">53 <form @submit.prevent="register()" method="POST"> 36 54 <label for="name" class="form-label" >Name</label> 37 <input type="text" id="name" name="firstName" class="form-control" placeholder="Name" required>55 <input v-model="form_info.firstName" type="text" id="name" name="firstName" class="form-control" placeholder="Name" required> 38 56 39 57 <label for="surname" class="form-label">Surname</label> 40 <input type="text" id="surname" name="lastName" class="form-control" placeholder="Surname" required>58 <input v-model="form_info.lastName" type="text" id="surname" name="lastName" class="form-control" placeholder="Surname" required> 41 59 42 60 <label for="phone_number" class="form-label">Phone Number</label> 43 <input type="text" id="phone_number" name="phoneNumber" class="form-control" required>61 <input v-model="form_info.phoneNumber" type="text" id="phone_number" name="phoneNumber" class="form-control" required> 44 62 45 63 <label for="email" class="form-label">Email Address</label> 46 <input type="email" id="email" name="email" class="form-control" placeholder="someone@example.com" required>64 <input v-model="form_info.email" type="email" id="email" name="email" class="form-control" placeholder="someone@example.com" required> 47 65 48 66 <label for="password" class="form-label">Password</label> 49 <input type="password" id="password" name="password" class="form-control">67 <input v-model="form_info.password" type="password" id="password" name="password" class="form-control"> 50 68 51 69 <label for="role" class="form-label">Role</label>
Note:
See TracChangeset
for help on using the changeset viewer.