From 383efcf264b0177ebc348d5481899e8631c0d62f Mon Sep 17 00:00:00 2001
From: Atiwit Pattanapukdee <65160394@go.buu.ac.th>
Date: Thu, 20 Mar 2025 17:56:15 +0700
Subject: [PATCH] Project Round 8

---
 views/index.ejs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/views/index.ejs b/views/index.ejs
index 4742675..91a7082 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> <!-- ปุ่มสำหรับลบทัวร์ -->
           <% } %>
-- 
GitLab