Ignore:
Timestamp:
02/13/25 10:05:35 (4 months ago)
Author:
ste08 <sjovanoska@…>
Branches:
master
Children:
a70b5a4
Parents:
57e58a3
Message:

Fix commiT

Location:
src/main/resources/static
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/main/resources/static/FlightSearch.html

    r57e58a3 r3d60932  
    165165                const bookingDate = new Date().toISOString().split('T')[0];
    166166
     167
    167168                const bookingData = {
    168                     flightId: flight.flightId,
     169                    flightId: flight.flightID,
    169170                    bookingDate: bookingDate,
    170171                    status: 'PENDING',
     
    174175                axios.post('/api/bookings', bookingData)
    175176                    .then(response => {
     177                        const bookingID = response.data.bookingID;
    176178                        alert("Booked successfully!");
    177                         window.location.href = `/transaction?amount=${encodeURIComponent(totalCost)}`;
     179                        window.location.href = `/transaction?amount=${encodeURIComponent(totalCost)}&bookingId=${encodeURIComponent(bookingID)}&flightId=${encodeURIComponent(flight.flightID)}`;
    178180                    })
    179181                    .catch(error => {
     
    189191
    190192                const wishlistData = {
    191                     targetId: flight.flightId,
     193                    targetId: flight.flightID,
    192194                    wishlisted: flight.wishlisted
    193195                };
     
    274276                    console.error("Error fetching flights", error);
    275277                });
    276             axios.get('api/bookings/getAll/${flight.flightID}')
     278            axios.get('api/bookings/getAll/${flight.flightId}')
    277279                .then(response => {
    278280                    console.log(response.data);
  • src/main/resources/static/ReviewPage.html

    r57e58a3 r3d60932  
    2020
    2121            <div class="review-list">
    22                 <div v-for="review in reviews" :key="review.id" class="review-item">
    23                     <h3>{{ review.subject }}</h3>
    24                     <p>{{ review.description }}</p>
     22                <div v-for="review in reviews" :key="review.reviewid" class="review-item">
     23                    <h3>Description</h3>
     24                    <p>{{ review.review_comment }}</p>
    2525                    <span>{{ review.date }}</span>
    2626                </div>
     
    2929    </div>
    3030</div>
    31 
     31<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
     32<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    3233<script>
    3334    new Vue({
    3435        el: '#app',
    3536        data: {
    36             reviews: [
    37                 {
    38                     id: 1,
    39                     subject: 'Great experience!',
    40                     description: 'The flight was amazing, the service was excellent, and the views were breathtaking.',
    41                     date: '2025-02-01',
    42                 },
    43                 {
    44                     id: 2,
    45                     subject: 'Good but delayed',
    46                     description: 'The flight was comfortable, but it was delayed by two hours, which caused some inconvenience.',
    47                     date: '2025-02-02',
    48                 },
    49                 {
    50                     id: 3,
    51                     subject: 'Okay, but not perfect',
    52                     description: 'Everything was fine, but the food options could have been better.',
    53                     date: '2025-02-03',
    54                 },
    55             ]
     37            reviews: []
    5638        },
    5739        methods: {
    5840            logout() {
    59                 // Logic to log out the user, e.g., clearing session or redirecting to home page
    60                 window.location.href = '/'; // Redirecting to home page
     41                window.location.href = '/';
    6142            }
     43        },
     44        mounted() {
     45            axios.get('api/reviews')
     46                .then(response => {
     47                    this.reviews = response.data;
     48                    console.log(response.data);
     49                })
     50                .catch(error => {
     51                    console.error("Error fetching reviews", error);
     52                });
    6253        }
    6354    });
  • src/main/resources/static/TransactionPage.html

    r57e58a3 r3d60932  
    5353        el: '#app',
    5454        data: {
     55            bookingId: '',
    5556            cardholder: '',
    5657            cardNumber: '',
     
    6364            this.flightId = urlParams.get('flightId');
    6465            this.amount = urlParams.get('amount');
     66            this.bookingId = urlParams.get('bookingId')
    6567
    6668            const user = JSON.parse(localStorage.getItem("user"));
     
    7981                    bookingId:this.bookingId
    8082                };
    81 
     83                console.log(transaction);
    8284                axios.post('api/payments', transaction)
    8385                    .then(response => {
    84                         console.log("Payment successful");
     86                        console.log(response.data);
    8587                        this.paymentSuccess = true;
    8688                        setTimeout(() => window.location.href = '/flights',2000);
  • src/main/resources/static/UserSignup.html

    r57e58a3 r3d60932  
    3535        <div class="form-group">
    3636            <label for="phoneNumber">Phone Number</label>
    37             <input type="text" id="phoneNumber" v-model="phoneNumber" required placeholder="Enter your phone number" />
     37            <input type="text" id="phoneNumber" v-model="phone_number" required placeholder="Enter your phone number" />
    3838        </div>
    3939
     
    5353            email: '',
    5454            password: '',
    55             phoneNumber: ''
     55            phone_number: ''
    5656        },
    5757        methods: {
    5858            signupUser() {
    59                 // Create user data object
    6059                const userData = {
    6160                    name: this.name,
     
    6362                    email: this.email,
    6463                    password: this.password,
    65                     phoneNumber: this.phoneNumber
     64                    phone_number: this.phone_number
    6665                };
    6766
    68                 // Send POST request to the backend
    6967                axios.post('http://localhost:8080/api/user/signup', userData)
    7068                    .then(response => {
  • src/main/resources/static/WishlistPage.html

    r57e58a3 r3d60932  
    8181            },
    8282            showReviews(flight) {
    83                 window.location.href = `/review?flightId=${flight.id}`;
     83                window.location.href = `/reviews?flightId=${flight.flightid}`;
    8484            },
    8585            logout() {
Note: See TracChangeset for help on using the changeset viewer.