Skip to content

Commit

Permalink
remove dist
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem committed Dec 22, 2024
1 parent aeff0be commit f809980
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 298 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

# production
/build
/dist

# misc
.DS_Store
Expand Down
62 changes: 36 additions & 26 deletions _api/send-telegram.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import type { VercelRequest, VercelResponse } from '@vercel/node';

export default async function handler(
req: VercelRequest,
res: VercelResponse
) {
if (req.method !== 'POST') {
return res.status(405).json({ message: 'Method not allowed' });
import type { VercelRequest, VercelResponse } from "@vercel/node";

export default async function handler(req: VercelRequest, res: VercelResponse) {
if (req.method !== "POST") {
return res.status(405).json({ message: "Method not allowed" });
}

try {
const { projectName, description, timeline, customTimeline, email } = req.body;
const { projectName, description, timeline, customTimeline, email } =
req.body;

// Validate required fields
if (!projectName || !description || !email || !(timeline || customTimeline)) {
return res.status(400).json({ message: 'Missing required fields' });
if (
!projectName ||
!description ||
!email ||
!(timeline || customTimeline)
) {
return res.status(400).json({ message: "Missing required fields" });
}

// Format message for Telegram
Expand All @@ -24,32 +27,39 @@ export default async function handler(
📝 Description: ${description}
⏰ Timeline: ${timeline === 'custom' ? customTimeline : timeline}
⏰ Timeline: ${timeline === "custom" ? customTimeline : timeline}
📧 Contact Email: ${email}
`;

// Send to Telegram
const response = await fetch(`https://api.telegram.org/bot${process.env.TELEGRAM_BOT_TOKEN}/sendMessage`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
const response = await fetch(
`https://api.telegram.org/bot${process.env.TELEGRAM_BOT_TOKEN}/sendMessage`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
chat_id: process.env.TELEGRAM_CHANNEL_ID,
text: message,
parse_mode: "HTML",
}),
},
body: JSON.stringify({
chat_id: process.env.TELEGRAM_CHANNEL_ID,
text: message,
parse_mode: 'HTML',
}),
});
);

if (!response.ok) {
const error = await response.json();
throw new Error(error.description || 'Failed to send message to Telegram');
throw new Error(
error.description || "Failed to send message to Telegram",
);
}

return res.status(200).json({ message: 'Project request sent successfully' });
return res
.status(200)
.json({ message: "Project request sent successfully" });
} catch (error) {
console.error('Error sending to Telegram:', error);
return res.status(500).json({ message: 'Error sending project request' });
console.error("Error sending to Telegram:", error);
return res.status(500).json({ message: "Error sending project request" });
}
}
Binary file removed dist/app.png
Binary file not shown.
21 changes: 0 additions & 21 deletions dist/assets/BuilderPage-r8Yi6Fa0.js

This file was deleted.

6 changes: 0 additions & 6 deletions dist/assets/Home-CvnzB4Tq.js

This file was deleted.

26 changes: 0 additions & 26 deletions dist/assets/Process-CEoypZlg.js

This file was deleted.

Loading

0 comments on commit f809980

Please sign in to comment.