Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 20be8fe5 authored by 65160394's avatar 65160394
Browse files

Project Round 6

parent 07035be0
No related branches found
No related tags found
No related merge requests found
......@@ -214,6 +214,12 @@ exports.searchTours = async (req, res) => {
try {
const searchQuery = req.query.query;
const tours = await Tour.searchTours(searchQuery);
// หากไม่พบทัวร์จากการค้นหา
if (tours.length === 0) {
return res.render('search', { tours: [], message: 'ไม่พบที่ค้นหา' });
}
res.render('search', { tours, session: req.session });
} catch (error) {
res.status(500).send("Error searching tours");
......
......@@ -9,7 +9,7 @@
</li>
<% }) %>
<% } else { %>
<p>No tours found</p>
<p>ไม่พบทัวร์ที่ค้นหา</p>
<% } %>
</ul>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment