Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
440 changes: 440 additions & 0 deletions app/api/send-email/route.ts

Large diffs are not rendered by default.

94 changes: 94 additions & 0 deletions app/applications/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@ export default function Applications() {
);

if (success) {
try {
const response = await fetch("/api/send-email", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
email: selectedApplication.email,
type: "rejected",
}),
});

if (!response.ok) {
const errorData = await response.json();
console.error("Failed to send rejection email:", errorData);
}
} catch (emailError) {
console.error("Error sending rejection email:", emailError);
}

setApplications((prev) =>
prev.map((app) =>
app.id === selectedApplication.id
Expand Down Expand Up @@ -171,6 +191,28 @@ export default function Applications() {
);

if (success) {
try {
const response = await fetch("/api/send-email", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
email: selectedApplication.email,
rsvpDeadline: "2025-07-01",
teamDeadline: "2025-07-01",
eventStartDate: "2025-07-24",
}),
});

if (!response.ok) {
const errorData = await response.json();
console.error("Failed to send acceptance email:", errorData);
}
} catch (emailError) {
console.error("Error sending acceptance email:", emailError);
}

setApplications((prev) =>
prev.map((app) =>
app.id === selectedApplication.id
Expand All @@ -192,6 +234,58 @@ export default function Applications() {
}
};

const handleWaitlistParticipant = async () => {
if (!selectedApplication) return;

try {
setRejecting(true);
const success = await updateUserStatus(
selectedApplication.id,
APPLICATION_STATUS.WAITLISTED
);

if (success) {
try {
const response = await fetch("/api/send-email", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
email: selectedApplication.email,
type: "waitlisted",
}),
});

if (!response.ok) {
const errorData = await response.json();
console.error("Failed to send waitlist email:", errorData);
}
} catch (emailError) {
console.error("Error sending waitlist email:", emailError);
}

setApplications((prev) =>
prev.map((app) =>
app.id === selectedApplication.id
? { ...app, status: APPLICATION_STATUS.WAITLISTED }
: app
)
);

setSelectedApplication((prev) =>
prev ? { ...prev, status: APPLICATION_STATUS.WAITLISTED } : null
);
} else {
console.error("Failed to waitlist participant");
}
} catch (error) {
console.error("Error waitlisting participant:", error);
} finally {
setRejecting(false);
}
};

const getDisplayStatus = (application: CombinedApplicationData): string => {
if (
application.status === APPLICATION_STATUS.SUBMITTED &&
Expand Down
2 changes: 2 additions & 0 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ export default function Sidebar() {
<Image
src="/assets/ghq.png"
alt="Garuda Hacks"
width={32}
height={32}
className="w-8 h-8 object-contain"
/>
</div>
Expand Down
7 changes: 7 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
};
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
"@vercel/analytics": "^1.5.0",
"firebase": "^11.8.1",
"next": "15.1.6",
"nodemailer": "^7.0.3",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@types/node": "^20",
"@types/nodemailer": "^6.4.17",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
Expand Down