From 3bf44140b0a6c2e90442f8b19e678ec78140cdba Mon Sep 17 00:00:00 2001 From: rameez1010 Date: Fri, 23 Feb 2024 11:08:46 +0530 Subject: [PATCH 1/2] feat: Topic Delection Bug --- .../modules/course-topics/TopicListView.tsx | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/audire/audire-dashboard/modules/course-topics/TopicListView.tsx b/audire/audire-dashboard/modules/course-topics/TopicListView.tsx index bb8acac..e29424c 100644 --- a/audire/audire-dashboard/modules/course-topics/TopicListView.tsx +++ b/audire/audire-dashboard/modules/course-topics/TopicListView.tsx @@ -9,14 +9,14 @@ import { TableHeader, TableRow, Tooltip, - useDisclosure + useDisclosure, } from '@nextui-org/react'; import React, { useState } from 'react'; import { CiEdit } from 'react-icons/ci'; import { IoMdAdd } from 'react-icons/io'; import { MdDelete } from 'react-icons/md'; import { columns } from './data'; -// import TopicForm from './TopicForm'; +import { Zoom, toast } from 'react-toastify'; import { TopicWithNumQuestions, useTopicDelete, @@ -33,7 +33,9 @@ const TopicListView: FC = () => { undefined ); const [stageId, setSelectedStage] = useState(undefined); - const [activeTopic, setActiveTopic] = useState(null); + const [activeTopic, setActiveTopic] = useState( + null + ); const { data: { data: topics } = { @@ -85,9 +87,7 @@ const TopicListView: FC = () => { case 'mcqQuestion': return ( - {topic.numQuestion > 0 - ? `✅ ${topic.numQuestion} MCQs` - : '❌'} + {topic.numQuestion > 0 ? `✅ ${topic.numQuestion} MCQs` : '❌'} ); @@ -149,11 +149,23 @@ const TopicListView: FC = () => { }) .catch((error) => { console.error('Delete error:', error); + if (error.code === '23503') { + toast.error('Please delete the contents in this topic', { + position: 'bottom-center', + autoClose: 3000, + hideProgressBar: false, + closeOnClick: true, + pauseOnHover: true, + draggable: true, + progress: undefined, + theme: 'colored', + transition: Zoom, + }); + } }); } }} /> - {/* */}

Topics

From 405a805a70d272363dde436af61a15c69499a4b6 Mon Sep 17 00:00:00 2001 From: Mohammed Fabinsha Date: Wed, 6 Mar 2024 12:08:23 +0530 Subject: [PATCH 2/2] fix: Master Merged --- audire/audire-dashboard/modules/login/LoginView.tsx | 4 ++-- libs/supabase/supabase/functions/_shared/fast2sms.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/audire/audire-dashboard/modules/login/LoginView.tsx b/audire/audire-dashboard/modules/login/LoginView.tsx index 53e107f..55e3ad0 100644 --- a/audire/audire-dashboard/modules/login/LoginView.tsx +++ b/audire/audire-dashboard/modules/login/LoginView.tsx @@ -11,7 +11,7 @@ import { useRouter } from 'next/router'; const LoginFormSchema = z.object({ email: z.string().email(), - password: z.string().min(8, 'Password must be at least 8 characters long'), + password: z.string(), }); type LoginForm = z.infer; @@ -75,7 +75,7 @@ const LoginView: FC = () => { className="block mt-6" name="password" placeholder="Enter your password" - type='password' + type="password" />