Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions frontend/src/app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import { validatePassword } from "@/lib/validatePassword";
import { Edit2, ExternalLink, Settings, X } from "lucide-react";
import { useRouter } from "next/navigation";
import React, { useState } from "react";
import Image from "next/image";
import Image from "next/image";
import {useStudents} from "@/hooks/useStudents";

const AdminProfile: React.FC = () => {
const { userId: therapistId } = useAuthContext();
const { therapist, error, refetch } = useTherapist(therapistId);
const { updateTherapist } = useTherapists({ fetchOnMount: false });
const { updatePassword, deleteAccount } = useAuth();
const { students, deleteStudent } = useStudents()
const router = useRouter();

const [isModalOpen, setIsModalOpen] = useState(false);
Expand Down Expand Up @@ -85,6 +87,10 @@ const AdminProfile: React.FC = () => {

const handleFinalDelete = async () => {
try {
students.forEach(student => {
deleteStudent(student.id)
})

const userId = localStorage.getItem("userId");

if (!userId) {
Expand Down Expand Up @@ -333,7 +339,7 @@ const AdminProfile: React.FC = () => {
onClose={() => setOpenDeleteConfirm(false)}
onConfirm={handleFinalDelete}
title="Delete Account"
description="This action is permanent and cannot be undone."
description="Please note that deleting your account will also delete all your students. This action is permanent and cannot be undone. Are you sure you'd like to continue?"
confirmText="Delete"
cancelText="Cancel"
variant="danger"
Expand Down
160 changes: 0 additions & 160 deletions frontend/src/app/therapistProfile/page.tsx

This file was deleted.