mirror of
				https://github.com/i701/sarlink-portal.git
				synced 2025-10-31 03:47:00 +00:00 
			
		
		
		
	Implement Omada device management and enhance payment processing
- Added new omada-actions.ts file to handle fetching and updating device groups in Omada. - Updated authMiddleware to include new payment routes. - Enhanced createPayment function to add devices to a group upon successful payment verification. - Improved payment verification process to include device management. - Refactored PaymentsTable and DevicesToPay components for better UI and state handling. - Removed unused hasSession function from auth-guard.ts for cleaner code.
This commit is contained in:
		| @@ -1,7 +1,7 @@ | ||||
| import DevicesToPay from "@/components/devices-to-pay"; | ||||
| import { auth } from "@/lib/auth"; | ||||
| import { hasSession } from "@/lib/auth-guard"; | ||||
| import prisma from "@/lib/db"; | ||||
| import { cn } from "@/lib/utils"; | ||||
| import { headers } from "next/headers"; | ||||
| import React from "react"; | ||||
| export default async function PaymentPage({ | ||||
| @@ -26,12 +26,14 @@ export default async function PaymentPage({ | ||||
|       devices: true, | ||||
|     }, | ||||
|   }); | ||||
|   await hasSession(); | ||||
|   const formula = await prisma.billFormula.findFirst(); | ||||
|   return ( | ||||
|     <div> | ||||
|       <div className="flex justify-between items-center border-b-2 text-gray-500 text-2xl font-bold title-bg py-4 px-2 mb-4"> | ||||
|         <h3>Payment</h3> | ||||
|         <span className={cn("text-sm border px-4 py-2 rounded-md uppercase font-semibold", payment?.paid ? "text-green-500 bg-green-500/20" : "text-yellow-500 bg-yellow-500/20")}> | ||||
|           {payment?.paid ? "Paid" : "Pending"} | ||||
|         </span> | ||||
|       </div> | ||||
|  | ||||
|       <div | ||||
|   | ||||
		Reference in New Issue
	
	Block a user