diff --git a/emails/user-registration-email-template.tsx b/emails/user-registration-email-template.tsx index 9998f99..8c3de85 100644 --- a/emails/user-registration-email-template.tsx +++ b/emails/user-registration-email-template.tsx @@ -32,7 +32,7 @@ export const TedxRegistrationEmail = ({ name, registrationLink }: TedxRegistrati {/* Logo Section */}
TEDxSJEC Logo diff --git a/package-lock.json b/package-lock.json index 947f60a..38f824c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "crypto": "^1.0.1", - "framer-motion": "^11.9.0", + "framer-motion": "^11.11.1", "gsap": "^3.12.5", "ioredis": "^5.4.1", "jest": "^29.7.0", @@ -1225,7 +1225,6 @@ "version": "3.9.0", "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-3.9.0.tgz", "integrity": "sha512-bU0Gr4EepJ/EQsH/IwEzYLsT/PEj5C0ynLQ4m+GSHS+xKH4TfSelhluTgOaoc4kA5s7eCsQbM4wvZLzELmWzUg==", - "license": "MIT", "peerDependencies": { "react-hook-form": "^7.0.0" } @@ -2947,7 +2946,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.0.tgz", "integrity": "sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw==", - "license": "MIT", "dependencies": { "@radix-ui/react-compose-refs": "1.1.0" }, @@ -6896,9 +6894,9 @@ } }, "node_modules/framer-motion": { - "version": "11.9.0", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.9.0.tgz", - "integrity": "sha512-nCfGxvsQecVLjjYDu35G2F5ls+ArE3FBfhxV0RSiisMaUKqteq5DMBFNRKwMyVj+VqKTNhawt+BV480YCHKFlQ==", + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.11.1.tgz", + "integrity": "sha512-Ucr9eHSrk0d+l6vyl9fvq6omh/PAWHjS+PlczpsoUdhJo1TuF3ULWJNuAMnpWQ1dGyPOyoUVuYlUKjE/s8dyCA==", "dependencies": { "tslib": "^2.4.0" }, diff --git a/package.json b/package.json index 651c5a0..66362e1 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "crypto": "^1.0.1", - "framer-motion": "^11.9.0", + "framer-motion": "^11.11.1", "gsap": "^3.12.5", "ioredis": "^5.4.1", "jest": "^29.7.0", diff --git a/src/app/actions/invalidate-coupon.ts b/src/app/actions/invalidate-coupon.ts index 7089a59..19a5a15 100644 --- a/src/app/actions/invalidate-coupon.ts +++ b/src/app/actions/invalidate-coupon.ts @@ -1,8 +1,8 @@ "use server"; import prisma from "@/server/db"; - -export async function invalidateCouponCode(couponCode: string) { +import { type Session as NextAuthSession } from "next-auth"; +export async function invalidateCouponCode(couponCode: string, session: NextAuthSession) { if (!couponCode) return; const resp = await prisma.referral.update({ where: { @@ -10,6 +10,7 @@ export async function invalidateCouponCode(couponCode: string) { }, data: { isUsed: true, + usedById: session.user.id, }, }); } diff --git a/src/app/actions/submit-form.ts b/src/app/actions/submit-form.ts new file mode 100644 index 0000000..4f51e99 --- /dev/null +++ b/src/app/actions/submit-form.ts @@ -0,0 +1,27 @@ +"use server"; + +import { FormDataInterface } from "@/components/common/registration-form"; +import { getServerSideSession } from "@/lib/get-server-session"; +import prisma from "@/server/db"; + +export async function submitForm(data: FormDataInterface, amount: number) { + const session = await getServerSideSession(); + if (!session) { + return; + } + + return await prisma.form.create({ + data: { + name: data.name, + usn: data.usn, + email: data.email, + contact: data.phone, + designation: data.designation, + paidAmount: amount, + photo: data.photo, + collegeIdCard: data.idCard, + createdById: session.user.id, + entityName: data.name, + }, + }); +} diff --git a/src/app/admin/layout.tsx b/src/app/admin/layout.tsx index 126cec8..a7ecb69 100644 --- a/src/app/admin/layout.tsx +++ b/src/app/admin/layout.tsx @@ -2,8 +2,8 @@ import type { Metadata } from "next"; import { Inter } from "next/font/google"; import "./globals.css"; -import Providers from "@/components/Layout/Provider"; -import { AdminNavbar } from "@/components/Admin/Navbar/navbar"; +import Providers from "@/components/layout/Provider"; +import { AdminNavbar } from "@/components/admin/Navbar/navbar"; import { useSession } from "next-auth/react"; const inter = Inter({ subsets: ["latin"] }); diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 216dd1e..80a02ca 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -1,5 +1,5 @@ "use client"; -import { Coupon } from "@/components/Admin/code-generation-card"; +import { Coupon } from "@/components/admin/code-generation-card"; import { useSession } from "next-auth/react"; export default function AdminPage() { const { data: session } = useSession(); diff --git a/src/app/admin/payment/page.tsx b/src/app/admin/payment/page.tsx index ee20a24..c995e17 100644 --- a/src/app/admin/payment/page.tsx +++ b/src/app/admin/payment/page.tsx @@ -1,4 +1,4 @@ -import { SearchableInfiniteScrollTable } from "@/components/searchable-infinite-scroll-table"; +import { SearchableInfiniteScrollTable } from "@/components/common/searchable-infinite-scroll-table"; import React from "react"; export default async function Payments() { diff --git a/src/app/admin/users/page.tsx b/src/app/admin/users/page.tsx index aefd080..897dc52 100644 --- a/src/app/admin/users/page.tsx +++ b/src/app/admin/users/page.tsx @@ -1,4 +1,4 @@ -import UsersList from "@/components/Admin/user-list"; +import UsersList from "@/components/admin/user-list"; import prisma from "@/server/db"; import React from "react"; diff --git a/src/app/api/submit-form/route.ts b/src/app/api/submit-form/route.ts index 7abaa15..b5ffb1a 100644 --- a/src/app/api/submit-form/route.ts +++ b/src/app/api/submit-form/route.ts @@ -55,7 +55,7 @@ export async function POST(req: NextRequest, res: NextResponse) { email, contact, designation, - photo, + photo: photo || "", collegeIdCard, entityName, referralUsed, diff --git a/src/app/api/verify-order/[id]/route.ts b/src/app/api/verify-order/[id]/route.ts index 5800c2e..5e8d026 100644 --- a/src/app/api/verify-order/[id]/route.ts +++ b/src/app/api/verify-order/[id]/route.ts @@ -5,13 +5,13 @@ import { getToken } from "next-auth/jwt"; import { NextRequest, NextResponse } from "next/server"; export async function GET(request: NextRequest, context: { params: { id: string } }) { - const session = await getToken({ req: request, secret: process.env.NEXTAUTH_SECRET }); - if (!session) { - return NextResponse.json({ message: "Unauthorized", isOk: false }, { status: 401 }); - } - if (session.role !== "ADMIN") { - return NextResponse.json({ message: "Forbidden", isOk: false }, { status: 403 }); - } + // const session = await getToken({ req: request, secret: process.env.NEXTAUTH_SECRET }); + // if (!session) { + // return NextResponse.json({ message: "Unauthorized", isOk: false }, { status: 401 }); + // } + // if (session.role !== "ADMIN") { + // return NextResponse.json({ message: "Forbidden", isOk: false }, { status: 403 }); + // } const { id } = context.params; try { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4b813b6..fb0218b 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,9 +1,9 @@ -import Providers from "@/components/Layout/Provider"; +import Providers from "@/components/layout/Provider"; import type { Metadata } from "next"; import { Inter } from "next/font/google"; import "./globals.css"; import { StarsCanvas } from "@/components/ui/stars"; -import Nav from "@/components/widget/header"; +import Navbar from "@/components/navbar"; // import ScrollProgress from "@/components/ui/progressBar"; const inter = Inter({ subsets: ["latin"] }); @@ -19,9 +19,9 @@ export default function RootLayout({ }>) { return ( - -