diff --git a/apps/marketing/src/app/page.tsx b/apps/marketing/src/app/page.tsx index 7e68d14..971bc2e 100644 --- a/apps/marketing/src/app/page.tsx +++ b/apps/marketing/src/app/page.tsx @@ -5,8 +5,6 @@ import { RocketLaunchIcon, EnvelopeIcon, MegaphoneIcon, - ChatBubbleOvalLeftEllipsisIcon, - BellAlertIcon, DevicePhoneMobileIcon, } from "@heroicons/react/24/solid"; import { @@ -136,6 +134,15 @@ export default function Home() { Unsend
+ + + + + hello@unsend.dev
+ + + + + /// -/// // NOTE: This file should not be edited // see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/apps/web/src/app/(dashboard)/emails/email-list.tsx b/apps/web/src/app/(dashboard)/emails/email-list.tsx index f97d1c9..04f787c 100644 --- a/apps/web/src/app/(dashboard)/emails/email-list.tsx +++ b/apps/web/src/app/(dashboard)/emails/email-list.tsx @@ -31,7 +31,7 @@ import { SelectTrigger, } from "@unsend/ui/src/select"; -/* Stupid hydrating error. And I so stupid to understand the stupid NextJS docs. Because they stupid change it everyday */ +/* Stupid hydrating error. And I so stupid to understand the stupid NextJS docs */ const DynamicSheetWithNoSSR = dynamic( () => import("@unsend/ui/src/sheet").then((mod) => mod.Sheet), { ssr: false } diff --git a/apps/web/src/app/(dashboard)/emails/page.tsx b/apps/web/src/app/(dashboard)/emails/page.tsx index 533bfe3..f798358 100644 --- a/apps/web/src/app/(dashboard)/emails/page.tsx +++ b/apps/web/src/app/(dashboard)/emails/page.tsx @@ -10,9 +10,7 @@ export default async function EmailsPage() {

Emails

- {/* Loading...
}> */} - {/* */} ); } diff --git a/apps/web/src/app/api/email/route.ts b/apps/web/src/app/api/email/route.ts deleted file mode 100644 index 71e6dcf..0000000 --- a/apps/web/src/app/api/email/route.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { headers } from "next/headers"; -import { hashToken } from "~/server/auth"; -import { db } from "~/server/db"; -import { sendEmail } from "~/server/service/email-service"; - -export async function GET() { - return Response.json({ data: "Hello" }); -} - -export async function POST(req: Request) { - const token = headers().get("authorization")?.split(" ")[1]; - console.log(token); - if (!token) { - return new Response("authorization token is required", { - status: 401, - }); - } - const hashedToken = hashToken(token); - const team = await db.team.findFirst({ - where: { - apiKeys: { - some: { - tokenHash: hashedToken, - }, - }, - }, - }); - - const data = await req.json(); - try { - const email = await sendEmail({ ...data, teamId: team?.id }); - return Response.json({ data: email }); - } catch (e) { - return Response.json({ error: (e as Error).message }, { status: 500 }); - } -} diff --git a/apps/web/src/server/public-api/auth.ts b/apps/web/src/server/public-api/auth.ts index 5f80d0e..17aa406 100644 --- a/apps/web/src/server/public-api/auth.ts +++ b/apps/web/src/server/public-api/auth.ts @@ -42,14 +42,16 @@ export const getTeamFromToken = async (c: Context) => { } // No await so it won't block the request. Need to be moved to a queue in future - db.apiKey.update({ - where: { - tokenHash: hashedToken, - }, - data: { - lastUsed: new Date(), - }, - }); + db.apiKey + .update({ + where: { + tokenHash: hashedToken, + }, + data: { + lastUsed: new Date(), + }, + }) + .catch(console.error); return team; };