Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: Waitlist signup not receiving correct response from server

Richie McIlroy1037f9918342
diff --git a/apps/web/app/api/waitlist/route.ts b/apps/web/app/api/waitlist/route.ts
index b12ba6637..ed689f9d6 100644
--- a/apps/web/app/api/waitlist/route.ts
+++ b/apps/web/app/api/waitlist/route.ts
@@ -8,31 +8,20 @@ export async function POST(request: Request) {
});
}
- console.log("email", email);
-
- const apiResponse = await fetch(
- "https://app.loops.so/api/v1/contacts/create",
- {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- Authorization: `Bearer ${process.env.NEXT_LOOPS_KEY}`,
- },
- body: JSON.stringify({
- email,
- userGroup: "Waitlist",
- source: "auth",
- }),
- }
- );
-
- if (apiResponse.ok) {
- return new Response("Success", {
- status: 200,
- });
- }
+ await fetch("https://app.loops.so/api/v1/contacts/create", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${process.env.NEXT_LOOPS_KEY}`,
+ },
+ body: JSON.stringify({
+ email,
+ userGroup: "Waitlist",
+ source: "auth",
+ }),
+ });
- return new Response("Error saving email", {
- status: 400,
+ return new Response("Success", {
+ status: 200,
});
}
diff --git a/apps/web/components/pages/HomePage.tsx b/apps/web/components/pages/HomePage.tsx
index 014ca42e6..c314cfc49 100644
--- a/apps/web/components/pages/HomePage.tsx
+++ b/apps/web/components/pages/HomePage.tsx
@@ -97,7 +97,7 @@ export const HomePage = () => {
placeholder="Your email address"
className="w-full h-full bg-white focus:outline-none outline-none px-3 text-sm sm:text-base text-black"
/>
- <button className="bg-primary-2 hover:bg-primary-3 border border-primary text-white font-medium text-sm sm:text-base py-1.5 px-3 min-w-[80px]">
+ <button className="bg-primary-2 hover:bg-primary-3 border border-primary text-white font-medium text-sm sm:text-base py-1.5 px-3 min-w-[100px]">
{waitlistLoading === true ? "Loading..." : "Submit"}
</button>
</form>