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

Fix commiT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    });
Note: See TracChangeset for help on using the changeset viewer.