SAR Link Portal
diff --git a/app/(dashboard)/payments/[paymentId]/page.tsx b/app/(dashboard)/payments/[paymentId]/page.tsx
index a624d42..78c49d8 100644
--- a/app/(dashboard)/payments/[paymentId]/page.tsx
+++ b/app/(dashboard)/payments/[paymentId]/page.tsx
@@ -2,10 +2,8 @@ import { getPayment } from "@/actions/payment";
import { authOptions } from "@/app/auth";
import CancelPaymentButton from "@/components/billing/cancel-payment-button";
import DevicesToPay from "@/components/devices-to-pay";
-import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { tryCatch } from "@/utils/tryCatch";
-import { Trash2 } from "lucide-react";
import { getServerSession } from "next-auth";
export default async function PaymentPage({
params,
diff --git a/app/(dashboard)/users/[userId]/verify/page.tsx b/app/(dashboard)/users/[userId]/verify/page.tsx
index 52c60ae..5d71178 100644
--- a/app/(dashboard)/users/[userId]/verify/page.tsx
+++ b/app/(dashboard)/users/[userId]/verify/page.tsx
@@ -1,11 +1,3 @@
-import InputReadOnly from "@/components/input-read-only";
-import { Badge } from "@/components/ui/badge";
-import UserRejectDialog from "@/components/user/user-reject-dialog";
-import { UserVerifyDialog } from "@/components/user/user-verify-dialog";
-import { getNationalPerson } from "@/lib/person";
-
-import Image from "next/image";
-
export default async function VerifyUserPage({
params,
}: {
@@ -14,6 +6,7 @@ export default async function VerifyUserPage({
}>;
}) {
const userId = (await params).userId;
+ console.log("userId", userId);
// const dbUser = await prisma.user.findUnique({
// where: {
// id: userId,
diff --git a/app/(dashboard)/users/page.tsx b/app/(dashboard)/users/page.tsx
index 2660b16..09fe406 100644
--- a/app/(dashboard)/users/page.tsx
+++ b/app/(dashboard)/users/page.tsx
@@ -1,4 +1,3 @@
-import { Rejectuser } from "@/actions/user-actions";
import Filter from "@/components/filter";
import Search from "@/components/search";
import { UsersTable } from "@/components/user-table";
@@ -9,8 +8,7 @@ import {
Hourglass,
Minus,
} from "lucide-react";
-import { redirect } from "next/navigation";
-import React, { Suspense } from "react";
+import { Suspense } from "react";
const sortfilterOptions = [
{
diff --git a/app/api/check-devices/route.ts b/app/api/check-devices/route.ts
index fa433eb..655cbaf 100644
--- a/app/api/check-devices/route.ts
+++ b/app/api/check-devices/route.ts
@@ -1,10 +1,5 @@
-import { blockDevice } from "@/actions/omada-actions";
-import { validateApiKey } from "@/lib/utils";
-import { addDays, addMonths, isAfter, isWithinInterval } from "date-fns";
-
-const lastRunTime = new Date();
-
export async function GET(request: Request) {
+ console.log(request.url);
return Response.json({ message: "Request received" });
// try {
// // Validate API key before proceeding
diff --git a/app/next-auth.d.ts b/app/next-auth.d.ts
index 0cce531..91dffdc 100644
--- a/app/next-auth.d.ts
+++ b/app/next-auth.d.ts
@@ -1,5 +1,7 @@
-import NextAuth, { DefaultSession, type User } from "next-auth";
-import { Session } from "next-auth";
+/* eslint-disable @typescript-eslint/no-unused-vars */
+// @ts-expect-error importing unused types are required here
+import NextAuth, { DefaultSession, type User, Session } from "next-auth";
+/* eslint-enable @typescript-eslint/no-unused-vars */
declare module "next-auth" {
/**
* Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context
diff --git a/components/admin/admin-devices-table.tsx b/components/admin/admin-devices-table.tsx
index 7dcd06b..0845be0 100644
--- a/components/admin/admin-devices-table.tsx
+++ b/components/admin/admin-devices-table.tsx
@@ -1,18 +1,18 @@
-import {
- Table,
- TableBody,
- TableCaption,
- TableCell,
- TableFooter,
- TableHead,
- TableHeader,
- TableRow,
-} from "@/components/ui/table";
-import { headers } from "next/headers";
-import Link from "next/link";
-import BlockDeviceDialog from "../block-device-dialog";
-import DeviceCard from "../device-card";
-import Pagination from "../pagination";
+// import {
+// Table,
+// TableBody,
+// TableCaption,
+// TableCell,
+// TableFooter,
+// TableHead,
+// TableHeader,
+// TableRow,
+// } from "@/components/ui/table";
+// import { headers } from "next/headers";
+// import Link from "next/link";
+// import BlockDeviceDialog from "../block-device-dialog";
+// import DeviceCard from "../device-card";
+// import Pagination from "../pagination";
export async function AdminDevicesTable({
searchParams,
@@ -25,12 +25,14 @@ export async function AdminDevicesTable({
}>;
parentalControl?: boolean;
}) {
+ console.log(parentalControl);
// const session = await auth.api.getSession({
// headers: await headers(),
// });
// const isAdmin = session?.user.role === "ADMIN";
- // const query = (await searchParams)?.query || "";
- // const page = (await searchParams)?.page;
+ const query = (await searchParams)?.query || "";
+ const page = (await searchParams)?.page;
+ console.log(query, page);
// const sortBy = (await searchParams)?.sortBy || "asc";
// const totalDevices = await prisma.device.count({
// where: {
diff --git a/components/admin/user-payments-table.tsx b/components/admin/user-payments-table.tsx
index d6d9e42..8c8f7e3 100644
--- a/components/admin/user-payments-table.tsx
+++ b/components/admin/user-payments-table.tsx
@@ -1,17 +1,17 @@
-import Pagination from "@/components/pagination";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import {
- Table,
- TableBody,
- TableCaption,
- TableCell,
- TableFooter,
- TableHead,
- TableHeader,
- TableRow,
-} from "@/components/ui/table";
-import Link from "next/link";
+// import Pagination from "@/components/pagination";
+// import { Badge } from "@/components/ui/badge";
+// import { Button } from "@/components/ui/button";
+// import {
+// Table,
+// TableBody,
+// TableCaption,
+// TableCell,
+// TableFooter,
+// TableHead,
+// TableHeader,
+// TableRow,
+// } from "@/components/ui/table";
+// import Link from "next/link";
export async function UsersPaymentsTable({
searchParams,
@@ -24,8 +24,9 @@ export async function UsersPaymentsTable({
}>;
}) {
const query = (await searchParams)?.query || "";
- const page = (await searchParams)?.page;
- const sortBy = (await searchParams)?.sortBy || "asc";
+ console.log(query);
+ // const page = (await searchParams)?.page;
+ // const sortBy = (await searchParams)?.sortBy || "asc";
// const totalPayments = await prisma.payment.count({
// where: {
// OR: [
diff --git a/components/auth/account-popver.tsx b/components/auth/account-popver.tsx
index fa60667..20aba64 100644
--- a/components/auth/account-popver.tsx
+++ b/components/auth/account-popver.tsx
@@ -7,13 +7,11 @@ import {
} from "@/components/ui/popover";
import { Loader2, User as UserIcon } from "lucide-react";
import { signOut, useSession } from "next-auth/react";
-import { useRouter } from "next/navigation";
import { useState } from "react";
export function AccountPopover() {
const session = useSession();
const [loading, setLoading] = useState(false);
- const router = useRouter();
if (session.status === "loading") {