@@ -133,14 +149,27 @@ const Navbar = () => {
{/* Mobile Menu Button */}
@@ -155,7 +184,7 @@ const Navbar = () => {
key={item.name}
to={item.path}
className={`block px-4 py-3 rounded-md text-base font-semibold transition duration-300
- ${mobileMenuBaseTextColorClass} hover:bg-amber-300 hover:text-black`}
+ ${mobileMenuBaseTextColorClass} hover:bg-amber-300 hover:text-black`}
>
{item.name}
@@ -164,7 +193,7 @@ const Navbar = () => {
@@ -172,7 +201,7 @@ const Navbar = () => {
@@ -184,4 +213,4 @@ const Navbar = () => {
);
};
-export default Navbar;
+export default Navbar;
\ No newline at end of file
From 9fe84514fed503a01f4b62018a588fd5fb68277d Mon Sep 17 00:00:00 2001
From: Arindam <17arindambera@gmail.com>
Date: Mon, 7 Oct 2024 05:20:48 +0530
Subject: [PATCH 2/4] code rabbit suggestion 1
---
backend/config/nodemailer.js | 11 ++++++++---
backend/controller/reservation.controller.js | 5 ++---
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/backend/config/nodemailer.js b/backend/config/nodemailer.js
index b1e7e47d..ad25a5c1 100644
--- a/backend/config/nodemailer.js
+++ b/backend/config/nodemailer.js
@@ -1,5 +1,6 @@
require("dotenv").config();
const nodemailer = require("nodemailer");
+const logger = require('./logger');
// Create a Nodemailer transporter using SMTP
const transporter = nodemailer.createTransport({
@@ -37,9 +38,13 @@ exports.sendReservationConfirmation = async (email, reservationDetails) => {
subject: "Reservation Confirmation",
text: emailText,
});
- console.log("Reservation confirmation sent successfully via email");
+ logger.info('Reservation confirmation sent successfully via email', { email });
} catch (error) {
- console.error("Error sending reservation confirmation email:", error);
- throw new Error("Failed to send reservation confirmation email");
+ logger.error('Failed to send reservation confirmation email', { error, email });
+ if (error.code === 'ECONNREFUSED') {
+ throw new Error('Failed to connect to email server. Please try again later.');
+ } else {
+ throw new Error(`Failed to send reservation confirmation email: ${error.message}`);
+ }
}
};
\ No newline at end of file
diff --git a/backend/controller/reservation.controller.js b/backend/controller/reservation.controller.js
index 09a84b9e..f86e079f 100644
--- a/backend/controller/reservation.controller.js
+++ b/backend/controller/reservation.controller.js
@@ -9,7 +9,7 @@ const reservationSchema = z.object({
date: z.string(),
time: z.string(),
email: z.string().email(), // Include email validation in the schema
-});
+}).strict(); // Disallow unknown keys
async function createReservation(req, res) {
try {
@@ -38,7 +38,6 @@ async function createReservation(req, res) {
} catch (emailError) {
logger.error("Error sending reservation confirmation email:", {
message: emailError.message,
- stack: emailError.stack,
});
// Email error should not block the main reservation process, so no need to return a failure response
}
@@ -46,7 +45,7 @@ async function createReservation(req, res) {
// Send the success response
res.status(201).json({
success: true,
- message: "Reservation created successfully, confirmation email sent",
+ message: "Reservation created successfully",
data: reservation,
});
} catch (error) {
From d6e8dccbbf995f3ecfc2e2054158aa2233861a67 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2024 20:32:42 +0000
Subject: [PATCH 3/4] docs(contributor): contrib-readme-action has updated
readme
---
README.md | 40 ++++++++++++++++++++++++++++------------
1 file changed, 28 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index fb3af533..5624a029 100644
--- a/README.md
+++ b/README.md
@@ -126,26 +126,26 @@ Special thanks to our amazing mentors who are guiding this project! 🙌
-
-
+
+
- Sajal Batra
+ Vishnu Prasad Korada
|
-
-
+
+
- Vishnu Prasad Korada
+ Sajal Batra
|
-
-
+
+
- Navneet Dadhich
+ Abhijit Motekar
|
@@ -156,10 +156,10 @@ Special thanks to our amazing mentors who are guiding this project! 🙌
|
-
-
+
+
- Abhijit Motekar
+ Navneet Dadhich
|
@@ -185,6 +185,13 @@ Special thanks to our amazing mentors who are guiding this project! 🙌
Jai Dhingra
|
+
+
+
+
+ Mohit Rana
+
+ |
@@ -199,6 +206,13 @@ Special thanks to our amazing mentors who are guiding this project! 🙌
Sapna Kul
|
+
+
+
+
+ Shiva Bajpai
+
+ |
@@ -206,6 +220,8 @@ Special thanks to our amazing mentors who are guiding this project! 🙌
Syed Faraz
|
+
+
From 964ef7ba636c36c5ba8f31e3f12f8eee6507aa80 Mon Sep 17 00:00:00 2001
From: Arindam <17arindambera@gmail.com>
Date: Tue, 8 Oct 2024 02:07:12 +0530
Subject: [PATCH 4/4] updated readme.example
---
backend/.env.example | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/backend/.env.example b/backend/.env.example
index c8cf3d4e..b547b64e 100644
--- a/backend/.env.example
+++ b/backend/.env.example
@@ -1 +1,3 @@
-MONGO_URI=enter_your_mongo_uri
\ No newline at end of file
+MONGO_URI=enter_your_mongo_uri
+EMAIL_USER=your_gmail
+EMAIL_PASS=your_16_digit_pass
\ No newline at end of file
|