diff --git a/routes/tourRoutes.js b/routes/tourRoutes.js index bf70451e97f53aba27968e09005bafec487c1c16..10071912d0c6bd69a7988e24409b0ba67ee7eb3c 100644 --- a/routes/tourRoutes.js +++ b/routes/tourRoutes.js @@ -34,7 +34,7 @@ router.post('/edit-profile', tourController.updateProfile);// อัปเดต //จองทัวร์ router.get('/my-bookings', tourController.getUserBookings); -router.get('/createbooking', tourController.getAllTours); +router.get('/create-booking', tourController.getAllTours); router.post('/create-booking', tourController.createBooking); router.post('/cancel/:id', tourController.cancelBooking); diff --git a/views/index.ejs b/views/index.ejs index 562cd905519f6dd01f7258e8ad358defafdf241f..64930c6e49c016f6c089b3e76e8ed0d1ddde1b89 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -13,7 +13,7 @@ <nav> <% if (session && session.id) { %> <a href="/create" class="btn-create">Create Tour</a> - <a href="/createbooking" class="btn-create">Create Booking</a> + <a href="/create-booking" class="btn-create">Create Booking</a> <% } %> <form action="/search" method="GET" class="search-container"> <input type="text" name="query" placeholder="Search for tours..." required> @@ -36,7 +36,7 @@ <li> <a href="/tour/<%= tour.id %>"><%= tour.name %></a> - <%= tour.price %> THB - <% if (session.id) { %> + <% if (session && session.id) { %> <a href="/edit/<%= tour.id %>" class="btn-edit">Edit</a> <!-- ปุ่มสำหรับแก้ไขทัวร์ --> <a href="/delete/<%= tour.id %>" class="btn-delete">Delete</a> <!-- ปุ่มสำหรับลบทัวร์ --> <% } %>