From e94c985d4dfba655384b8cb6a864af32fbb247df Mon Sep 17 00:00:00 2001 From: Sinan Date: Thu, 10 Oct 2024 07:50:37 +0530 Subject: [PATCH] lint errors solved --- client/components/button/DownloadPrescriptionButton.tsx | 2 +- client/components/button/NotificationButtonDoctor.tsx | 6 +++--- client/components/button/NotificationButtonPatient.tsx | 6 +++--- client/components/page-components/chatbot/ChatSection.tsx | 2 +- .../page-components/landing/clinicians/AyurvedaSection.tsx | 2 ++ server/src/config/connectDB.ts | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/client/components/button/DownloadPrescriptionButton.tsx b/client/components/button/DownloadPrescriptionButton.tsx index 5239c18f..c3a82b22 100644 --- a/client/components/button/DownloadPrescriptionButton.tsx +++ b/client/components/button/DownloadPrescriptionButton.tsx @@ -29,7 +29,7 @@ const DownloadPrescriptionButton = ({ prescription, doctor, patient }: Props) => } catch (error) { console.error('Error generating PDF:', error); } - }, []); + }, [prescription, doctor, patient]); return ( diff --git a/client/components/button/NotificationButtonDoctor.tsx b/client/components/button/NotificationButtonDoctor.tsx index 5f455139..3e85e48e 100644 --- a/client/components/button/NotificationButtonDoctor.tsx +++ b/client/components/button/NotificationButtonDoctor.tsx @@ -15,18 +15,18 @@ const NotificationButtonDoctor = forwardRef((props, ref) => { const handleNotificationClick = useCallback(() => { setIsNotificationModalOpen(true); - }, [isNotificationModalOpen]); + }, []); const handleClearSingleNotification = useCallback((notificationId: string) => { clearNotification(notificationId); - }, [notifications]); + }, [notifications, clearNotification]); const handleClearAllNotifications = useCallback(() => { if (!notifications || notifications.length === 0) return; const notificationIds = notifications.map((notification) => notification._id!); clearAllNotifications(notificationIds); - },[notifications]); + }, [notifications,clearAllNotifications]); return ( <> diff --git a/client/components/button/NotificationButtonPatient.tsx b/client/components/button/NotificationButtonPatient.tsx index 876119a2..d632568c 100644 --- a/client/components/button/NotificationButtonPatient.tsx +++ b/client/components/button/NotificationButtonPatient.tsx @@ -20,17 +20,17 @@ const NotificationButtonPatient = () => { const handleNotificationClick = useCallback(() => { setIsNotificationModalOpen(true); - },[isNotificationModalOpen]); + },[]); const handleClearSingleNotification = useCallback((notificationId: string) => { clearNotification(notificationId); - },[notifications]); + },[notifications, clearAllNotifications]); const handleClearAllNotifications = useCallback(() => { if (!notifications || notifications.length === 0) return; const notificationsIds = notifications.map(el => el._id!); clearAllNotifications(notificationsIds); - },[notifications]); + },[notifications, clearAllNotifications]); return ( <> diff --git a/client/components/page-components/chatbot/ChatSection.tsx b/client/components/page-components/chatbot/ChatSection.tsx index 499f4912..32ddf4d8 100644 --- a/client/components/page-components/chatbot/ChatSection.tsx +++ b/client/components/page-components/chatbot/ChatSection.tsx @@ -65,7 +65,7 @@ const ChatSection = ({ isVisible, setIsOpen, isAuthenticated }: Props) => { } ); } - }, [inputMessage, setInputMessage, setIsTyping, getRandomId]); + }, [inputMessage, setInputMessage, setIsTyping, createMessage]); return ( setIsOpen(false)}> diff --git a/client/components/page-components/landing/clinicians/AyurvedaSection.tsx b/client/components/page-components/landing/clinicians/AyurvedaSection.tsx index a1c8ff30..e6e0ce09 100644 --- a/client/components/page-components/landing/clinicians/AyurvedaSection.tsx +++ b/client/components/page-components/landing/clinicians/AyurvedaSection.tsx @@ -31,3 +31,5 @@ export const AyurvedaSection = memo(() => ( )); + +AyurvedaSection.displayName = "AyurvedaSection"; \ No newline at end of file diff --git a/server/src/config/connectDB.ts b/server/src/config/connectDB.ts index cec8d414..32ab17a4 100644 --- a/server/src/config/connectDB.ts +++ b/server/src/config/connectDB.ts @@ -3,7 +3,7 @@ import { MONGODB_URL } from "./env"; export const connectDB = async () => { try { - await connect(`${MONGODB_URL}/AVM`); + await connect(`${MONGODB_URL}`); } catch (error) { console.log("Error in Connecting MongoDB ", error); }