diff --git a/views/index.ejs b/views/index.ejs index 4742675629d43b53cb4e10edcb8c09c9037a75f8..91a70828d77b485de3307047e06310da0c7e0b06 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -11,7 +11,7 @@ <header> <h1>Welcome to JourneyHub</h1> <nav> - <% if (session.userId) { %> + <% if (session.id) { %> <a href="/create" class="btn-create">Create Tour</a> <% } %> <form action="/search" method="GET" class="search-container"> @@ -19,7 +19,7 @@ <button type="submit">Search</button> </form> - <% if (session && session.userId) { %> <!-- ตรวจสอบ session --> + <% if (session && session.id) { %> <!-- ตรวจสอบ session --> <a href="/logout">Logout</a> <a href="/my-bookings">My-Booking</a> <% } else { %> @@ -35,7 +35,7 @@ <li> <a href="/tour/<%= tour.id %>"><%= tour.name %></a> - <%= tour.price %> THB - <% if (session.userId) { %> + <% if (session.id) { %> <a href="/edit/<%= tour.id %>" class="btn-edit">Edit</a> <!-- ปุ่มสำหรับแก้ไขทัวร์ --> <a href="/delete/<%= tour.id %>" class="btn-delete">Delete</a> <!-- ปุ่มสำหรับลบทัวร์ --> <% } %>