Changeset dad25fc
- Timestamp:
- 04/29/25 14:46:06 (37 hours ago)
- Branches:
- master
- Children:
- 7d8eeab
- Parents:
- e0ee7c8
- Location:
- ReserveNGo-frontend/src
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ReserveNGo-frontend/src/PiniaStores/restaurantStore.js
re0ee7c8 rdad25fc 24 24 this.workingHours = workingHours 25 25 this.availableServices = availableServices 26 }, 27 newRestaurant (id) { 28 this.id = id 26 29 } 27 30 }, -
ReserveNGo-frontend/src/components/Project/Nav_bar_new.vue
re0ee7c8 rdad25fc 89 89 <a v-if="userStore_.data.role==='UN_AUTHENTICATED'" class="btn btn-dark ms-2">Register</a> 90 90 </router-link> 91 <router-link to="/addRestaurant"> 92 <a v-if="userStore_.data.role==='ROLE_LOCAL_MANAGER' || userStore_.data.role==='ROLE_ADMIN'" class="btn btn-dark me-2">Add Restaurant</a> 93 </router-link> 91 94 <logout_></logout_> 92 95 </li> -
ReserveNGo-frontend/src/components/Project/login_.vue
re0ee7c8 rdad25fc 28 28 await fetch(this.url, { 29 29 method: 'POST', 30 headers: { 'Content-Type': 'application/ x-www-form-urlencoded'},31 body: new URLSearchParams({32 33 password: this.form_info.password30 headers: { 'Content-Type': 'application/json'}, 31 body: JSON.stringify({ 32 email: this.form_info.email, 33 password: this.form_info.password, 34 34 }) 35 35 }).then((response) => response.json()) -
ReserveNGo-frontend/src/components/Project/register_.vue
re0ee7c8 rdad25fc 36 36 37 37 methods: { 38 async register() {39 await fetch(this.wholeUrl, {38 async register() { 39 await fetch(this.wholeUrl, { 40 40 method: 'POST', 41 headers: { 'Content-Type': 'application/ x-www-form-urlencoded' },42 body: new URLSearchParams({41 headers: { 'Content-Type': 'application/json' }, 42 body: JSON.stringify({ 43 43 firstName: this.form_info.firstName, 44 44 lastName: this.form_info.lastName, 45 45 email: this.form_info.email, 46 46 password: this.form_info.password, 47 phoneNumber: this.form_info.phoneNumber}) 48 }).then((response) => response.json()) 49 .then((json) => {this.userStore_.setLocalStorage(json); 50 router.push('/')}) 51 //console.log("Data received:", this.data); 47 phoneNumber: this.form_info.phoneNumber 48 }) 49 }) 50 .then((response) => response.json()) 51 .then((json) => { 52 this.userStore_.setLocalStorage(json); 53 router.push('/'); 54 }); 55 //console.log("Data received:", this.data); 52 56 //this.userStore_.setLocalStorage(json) 53 57 //console.log(json) -
ReserveNGo-frontend/src/router/index.js
re0ee7c8 rdad25fc 8 8 import my_reservations from '@/components/Project/My_reservations.vue' 9 9 import Locale_ from '@/components/Project/Locale_.vue' 10 import AddRestaurant from "@/components/Project/AddRestaurant.vue"; 10 11 11 12 const router = createRouter({ … … 45 46 name: 'more_details', 46 47 component: Locale_, 48 }, 49 { 50 path: '/addRestaurant', 51 name: 'addRestaurant', 52 component: AddRestaurant, 47 53 } 48 54 ],
Note:
See TracChangeset
for help on using the changeset viewer.