From 55bd8e0a54d4934a291d2a8abaf958cb0896d473 Mon Sep 17 00:00:00 2001 From: Sir Blob <76974209+GamerBoss101@users.noreply.github.com> Date: Sat, 25 Jan 2025 16:03:21 -0500 Subject: [PATCH] Patient Update 2 --- .../(panels)/suite/patient/account/page.jsx | 117 +++++++++++------- 1 file changed, 70 insertions(+), 47 deletions(-) diff --git a/src/app/(panels)/suite/patient/account/page.jsx b/src/app/(panels)/suite/patient/account/page.jsx index 613633b..3786cbf 100644 --- a/src/app/(panels)/suite/patient/account/page.jsx +++ b/src/app/(panels)/suite/patient/account/page.jsx @@ -7,15 +7,9 @@ import { Button } from '@/components/ui/button'; import { Label } from '@/components/ui/label'; import { Card, CardHeader, CardContent } from '@/components/ui/card'; -import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible" -import { ChevronDown } from "lucide-react" - -import { PersonForm } from './PatientForm'; - const AccountPage = () => { const { user } = useUser(); const [userData, setUserData] = useState(null); - const [patients, setPatients] = useState([]); useEffect(() => { if (user) { @@ -28,20 +22,24 @@ const AccountPage = () => { } }, [user]); - const handleRoleChange = async () => { - const newRole = userData.role === 'patient' ? 'caregiver' : 'patient'; - await axios.put(`/api/user?userId=${user.id}`, { role: newRole }); - setUserData({ ...userData, role: newRole }); - if (newRole === 'caregiver') { - axios.get('/api/patients').then(res => setPatients(res.data)); - } else { - setPatients([]); - setSelectedPatient(null); - } - }; - if (!userData) return
{userData.role}
{patient.role}
-