From b9702084687c03276f28dba936d2a3cdc8785806 Mon Sep 17 00:00:00 2001 From: vyshnav Date: Thu, 3 Oct 2024 16:01:31 +0530 Subject: [PATCH 1/4] fix issue if there is no coupon --- src/app/actions/invalidate-coupon.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/app/actions/invalidate-coupon.ts b/src/app/actions/invalidate-coupon.ts index 0157279..7089a59 100644 --- a/src/app/actions/invalidate-coupon.ts +++ b/src/app/actions/invalidate-coupon.ts @@ -1,14 +1,15 @@ -"use server" +"use server"; -import prisma from "@/server/db" +import prisma from "@/server/db"; -export async function invalidateCouponCode(couponCode:string){ +export async function invalidateCouponCode(couponCode: string) { + if (!couponCode) return; const resp = await prisma.referral.update({ - where:{ - code:couponCode + where: { + code: couponCode, }, - data:{ - isUsed:true - } - }) -} \ No newline at end of file + data: { + isUsed: true, + }, + }); +} From dbf0084dc644783262344c2586f2654f55863a75 Mon Sep 17 00:00:00 2001 From: vyshnav Date: Thu, 3 Oct 2024 16:02:14 +0530 Subject: [PATCH 2/4] add notes to store customerName , email and contacts --- src/components/payment.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/payment.tsx b/src/components/payment.tsx index d41cccd..8794f1e 100644 --- a/src/components/payment.tsx +++ b/src/components/payment.tsx @@ -78,6 +78,12 @@ export function Payment() { alert("Payment failed"); } }, + // change to dynamic + notes: { + customerName: "John Doe", + customerEmail: "jhondoe@something.com", + customerContact: "9999999999", + }, prefill: { name: "John Doe", email: "jhondoe@something.com", From b725a457359304f8e504b4b15672ceb0c421ef56 Mon Sep 17 00:00:00 2001 From: vyshnav Date: Thu, 3 Oct 2024 16:02:25 +0530 Subject: [PATCH 3/4] Refactor email subject and content in sendRegistrationEmail --- src/lib/send-registration-email.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/send-registration-email.ts b/src/lib/send-registration-email.ts index 4d1cc1d..ef34926 100644 --- a/src/lib/send-registration-email.ts +++ b/src/lib/send-registration-email.ts @@ -17,9 +17,8 @@ export async function sendRegistrationEmail({ await resend.emails.send({ from: '"Tedx SJEC" ', to: email, - subject: "Tedx SJEC - Email Verification", + subject: "Event Registration Successful - TEDx SJEC", react: TedxRegistrationEmail({ name, registrationLink }), - text: `Hello ${name},\n\nThank you for registering for Tedx 2024.\n\nPlease click on the link below to complete your registration.\n\n${registrationLink}\n\nThank you!\n\nTedx SJEC Team`, }); } catch (error) { console.log(error); From 8b673597ecc1053e705aff7e906e7fdbe048bd27 Mon Sep 17 00:00:00 2001 From: vyshnav Date: Thu, 3 Oct 2024 17:21:20 +0530 Subject: [PATCH 4/4] add : rupee symbol --- src/components/searchable-infinite-scroll-table.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/searchable-infinite-scroll-table.tsx b/src/components/searchable-infinite-scroll-table.tsx index 05e190a..964c344 100644 --- a/src/components/searchable-infinite-scroll-table.tsx +++ b/src/components/searchable-infinite-scroll-table.tsx @@ -154,7 +154,7 @@ export function SearchableInfiniteScrollTable() { {item.usn} {item.razorpayPaymentId} {item.contactNumber} - ${item.amount.toFixed(2)} + ₹{item.amount.toFixed(2)} ))}