Ignore:
Timestamp:
04/29/25 15:00:55 (44 hours ago)
Author:
Nikola Jordanoski <nikolaj_koko@…>
Branches:
master
Children:
349551d
Parents:
bf78464 (diff), dad25fc (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://github.com/nikolakoko/ReserveNGo

Location:
ReserveNGo-frontend/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • ReserveNGo-frontend/src/PiniaStores/restaurantStore.js

    rbf78464 r7d8eeab  
    2424      this.workingHours = workingHours
    2525      this.availableServices = availableServices
     26    },
     27    newRestaurant (id) {
     28      this.id = id
    2629    }
    2730  },
  • ReserveNGo-frontend/src/components/Project/Nav_bar_new.vue

    rbf78464 r7d8eeab  
    8989            <a v-if="userStore_.data.role==='UN_AUTHENTICATED'" class="btn btn-dark ms-2">Register</a>
    9090            </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>
    9194            <logout_></logout_>
    9295          </li>
  • ReserveNGo-frontend/src/components/Project/login_.vue

    rbf78464 r7d8eeab  
    2828      await fetch(this.url, {
    2929        method: 'POST',
    30         headers: { 'Content-Type': 'application/x-www-form-urlencoded'},
    31         body: new URLSearchParams({
    32             email: this.form_info.email,
    33             password: this.form_info.password
     30        headers: { 'Content-Type': 'application/json'},
     31        body: JSON.stringify({
     32          email: this.form_info.email,
     33          password: this.form_info.password,
    3434        })
    3535      }).then((response) => response.json())
  • ReserveNGo-frontend/src/components/Project/register_.vue

    rbf78464 r7d8eeab  
    3636
    3737  methods: {
    38    async register() {
    39      await fetch(this.wholeUrl, {
     38    async register() {
     39      await fetch(this.wholeUrl, {
    4040        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({
    4343          firstName: this.form_info.firstName,
    4444          lastName: this.form_info.lastName,
    4545          email: this.form_info.email,
    4646          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);
    5256          //this.userStore_.setLocalStorage(json)
    5357        //console.log(json)
  • ReserveNGo-frontend/src/router/index.js

    rbf78464 r7d8eeab  
    88import my_reservations from '@/components/Project/My_reservations.vue'
    99import Locale_ from '@/components/Project/Locale_.vue'
     10import AddRestaurant from "@/components/Project/AddRestaurant.vue";
    1011
    1112const router = createRouter({
     
    4546      name: 'more_details',
    4647      component: Locale_,
     48    },
     49    {
     50      path: '/addRestaurant',
     51      name: 'addRestaurant',
     52      component: AddRestaurant,
    4753    }
    4854  ],
Note: See TracChangeset for help on using the changeset viewer.