diff --git a/client/src/components/ui/Users/login-modal.tsx b/client/src/components/ui/Users/login-modal.tsx
index 164581b7..95b17f15 100644
--- a/client/src/components/ui/Users/login-modal.tsx
+++ b/client/src/components/ui/Users/login-modal.tsx
@@ -152,10 +152,10 @@ export function LoginModal({ children }: LoginFormProps) {
-
+ {/*
It must be a combination of minimum 8 letters, numbers,
and symbols
-
+ */}
diff --git a/client/src/components/ui/Users/school-data-grid.tsx b/client/src/components/ui/Users/school-data-grid.tsx
index ab2a1fb8..a86041d4 100644
--- a/client/src/components/ui/Users/school-data-grid.tsx
+++ b/client/src/components/ui/Users/school-data-grid.tsx
@@ -1,4 +1,6 @@
+import { useRouter } from "next/router";
import React, { useEffect, useState } from "react";
+import { toast } from "sonner";
import { Button } from "@/components/ui/button";
import { Pagination } from "@/components/ui/pagination";
@@ -10,6 +12,7 @@ import {
TableHeader,
TableRow,
} from "@/components/ui/table";
+import { useDynamicDeleteMutation } from "@/hooks/use-delete-data";
import { cn } from "@/lib/utils";
import { DatagridProps } from "@/types/data-grid";
import { School } from "@/types/user";
@@ -29,11 +32,28 @@ export function SchoolDataGrid({
onDataChange,
changePage,
}: DatagridProps) {
+ const router = useRouter();
const [currentPage, setCurrentPage] = useState(1);
const [paddedData, setPaddedData] = useState([]);
const itemsPerPage = 5;
const totalPages = Math.ceil(datacontext.length / itemsPerPage);
+ const { mutate: deleteSchool, isPending } = useDynamicDeleteMutation({
+ baseUrl: "/users/schools",
+ mutationKey: ["school_delete"],
+ onSuccess: () => {
+ router.reload();
+ toast.success("School has been deleted.");
+ },
+ });
+
+ const onDelete = (id: number) => {
+ if (!window.confirm("Are you sure you want to delete this school?")) {
+ return;
+ }
+ deleteSchool(id);
+ };
+
const handlePageChange = (page: number) => {
if (page >= 1 && page <= totalPages) {
setCurrentPage(page);
@@ -97,8 +117,18 @@ export function SchoolDataGrid({