Skip to content

Commit

Permalink
refactor: rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dulapahv committed Aug 10, 2024
1 parent 18f0371 commit d1b692d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/app/api/send/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export const runtime = "edge";
const resend = new Resend(process.env.RESEND_API_KEY);

export async function POST(req: NextRequest) {
const fullName = req.nextUrl.searchParams.get("name");
const name = req.nextUrl.searchParams.get("name");
const email = req.nextUrl.searchParams.get("email");
const type = req.nextUrl.searchParams.get("type");
const message = req.nextUrl.searchParams.get("message");

if (!fullName || !email || !type || !message) {
if (!name || !email || !type || !message) {
const error = {
message: "Please fill in all required fields",
name: "missing_required_field",
Expand All @@ -28,9 +28,9 @@ export async function POST(req: NextRequest) {
const { data, error } = await resend.emails.send({
from: `${NAME} <${process.env.EMAIL}>`,
to: [`${process.env.EMAIL}`],
subject: `✨ ${type} - ${fullName}`,
subject: `✨ ${type} - ${name}`,
react: EmailTemplate({
fullName,
name: name,
email,
type,
message,
Expand Down
2 changes: 1 addition & 1 deletion src/types/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type EmailTemplateProps = {
readonly fullName: string;
readonly name: string;
readonly email: string;
readonly type: string;
readonly message: string;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/email-template/email-template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { EmailTemplateProps } from "@/types/types";
import { ASSETS_URL, BASE_URL, LINKEDIN_URL } from "@/lib/constants";

export function EmailTemplate({
fullName,
name: fullName,
email,
type,
message,
Expand Down

0 comments on commit d1b692d

Please sign in to comment.