diff --git a/src/app/(dashboard)/customers/birthday/page.tsx b/src/app/(dashboard)/customers/birthday/page.tsx index 702cef8..30f3536 100644 --- a/src/app/(dashboard)/customers/birthday/page.tsx +++ b/src/app/(dashboard)/customers/birthday/page.tsx @@ -1,7 +1,9 @@ import { Prisma } from "@prisma/client"; import { prisma } from "@/lib/prisma"; +import { auth } from "@/lib/auth"; +import { isSuperAdmin } from "@/lib/acl"; import { birthdayMatchLists } from "@/lib/lunar"; -import { fmtDate } from "@/lib/utils"; +import { fmtDate, maskPhone } from "@/lib/utils"; import { Card } from "@/components/ui/card"; import { Table, THead, TR, TH, TD } from "@/components/ui/table"; import { Badge } from "@/components/ui/badge"; @@ -33,6 +35,8 @@ export default async function BirthdayPage({ }: { searchParams: Promise<{ mode?: string; date?: string }>; }) { + const session = await auth(); + const superAdmin = isSuperAdmin(session?.user?.roles); const sp = await searchParams; const mode = sp.mode === "week" ? "week" : "today"; const dateStr = sp.date ?? ""; @@ -98,7 +102,7 @@ export default async function BirthdayPage({ {c.customerName} {c.contacts} - {c.phone} + {superAdmin ? c.phone : maskPhone(c.phone)} {c.salesman} {fmtDate(c.birthday)}