Skip to content

Commit

Permalink
Merge pull request #74 from TEDx-SJEC/deploy/test
Browse files Browse the repository at this point in the history
fix:improved error handling
  • Loading branch information
joywin2003 authored Nov 22, 2024
2 parents 7d54f65 + 03e406d commit cdd543b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion emails/user-registration-email-template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const TedxRegistrationEmail = ({ name, registrationLink }: TedxRegistrati
<Text className="text-black text-[14px] leading-[24px]">
Dear {name ?? "Participant"},
</Text>
<Text className="text-black text-[14px] leading-[24px] text-justify">
<Text className="text-black text-[14px] leading-[24px] justify-center">
We are excited to confirm your registration for TEDxSJEC 2024. <br />
You are all set to join us for an inspiring day filled with ideas worth sharing.
Please bring this email on the event day for a smooth entry process.
Expand Down
7 changes: 6 additions & 1 deletion src/app/admin/razorpay/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,15 @@ function FetchRazorpayPaymentData({ params }: { params: { id: string } }) {
const fetchData = async () => {
try {
const res = await fetch(`/api/verify-order/${id}`);
if (!res.ok) {
throw new Error("Failed to fetch payment data");
}
const data = await res.json();
console.log("Payment data:", data);
setPaymentData(data);
} catch (error) {
console.error("Error fetching payment data:", error);
toast.error("Error fetching payment data");

} finally {
setLoading(false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/cta-section-2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function FullScreenCTA() {
size="lg"
className="bg-red-600 hover:bg-red-700 text-white py-6 px-4 text-xl transition-all duration-300 transform hover:scale-105"
>
Registrations Open Soon
Register
</Button>
{/* <p className="text-sm text-gray-400">
Early bird pricing ends May 1st. Secure your spot today and save!
Expand Down
2 changes: 1 addition & 1 deletion src/components/widget/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const Nav = () => {
size="lg"
className="bg-red-600 hover:bg-red-700 text-white py-4 "
>
Registrations Open Soon
Register
{/* <ArrowRight className="ml-2" /> */}
</Button>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion src/components/widget/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default function HeroHighlight() {
size="lg"
className="bg-red-600 hover:bg-red-700 text-white py-2 transition-all duration-300 transform hover:scale-105"
>
Registrations Open Soon
Register
</Button>
</Link>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export async function middleware(request: NextRequest) {
return NextResponse.redirect(new URL("/", request.url));
}
}
if (url.pathname.startsWith("/register")) {
if (token?.role !== "ADMIN") {
return NextResponse.redirect(new URL("/", request.url));
}
}
// if (url.pathname.startsWith("/register")) {
// if (token?.role !== "ADMIN") {
// return NextResponse.redirect(new URL("/", request.url));
// }
// }

}

Expand Down

0 comments on commit cdd543b

Please sign in to comment.