This repository has been archived by the owner on Mar 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create param validator * Move discord * Move user settings getter to app router * Use standard var * move getAllPublicUserData to app router * Better error handling * Delete getAllData.ts * Delete discord * Throw errors * Handle error throwing * Move updateSettings to app router * Update confluence.svg * Configure jest * Create settings.test.ts * Create updateSettings.test.ts * Add getting test * Use generalized validator * Move Stripe to app router * Move Sendgrid to app router * Move vscode to airtable Analytics to app router * Frontend analytics * Change export * Fix export * Fix export
- Loading branch information
1 parent
fa8d582
commit 6eafdab
Showing
11 changed files
with
157 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { NextResponse } from "next/server"; | ||
import validateParams from "../../../../utils/api/validateParams"; | ||
import sendTeammateInvite from "../../../../utils/sendgrid/sendTeammateInvite"; | ||
|
||
export async function POST(request: Request) { | ||
const req = await request.json(); | ||
const { missingParams } = validateParams(req, [ | ||
"sender", | ||
"email", | ||
"inviteUrl", | ||
"teamName", | ||
]); | ||
|
||
if (missingParams.length > 0) { | ||
return NextResponse.json({ | ||
error: `Missing parameters: ${missingParams.join(", ")}`, | ||
}); | ||
} | ||
const { sender, email, inviteUrl, teamName } = req; | ||
|
||
let emailSent = await sendTeammateInvite({ | ||
sender, | ||
teammateEmail: email, | ||
inviteUrl, | ||
teamName, | ||
}); | ||
return NextResponse.json(emailSent); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { NextResponse } from "next/server"; | ||
import validateParams from "../../../../utils/api/validateParams"; | ||
import sendWelcome from "../../../../utils/sendgrid/sendWelcome"; | ||
|
||
export async function POST(request: Request) { | ||
const req = await request.json(); | ||
const { missingParams } = validateParams(req, ["sender", "emails"]); | ||
|
||
if (missingParams.length > 0) { | ||
return NextResponse.json({ | ||
error: `Missing parameters: ${missingParams.join(", ")}`, | ||
}); | ||
} | ||
const { sender, emails } = req; | ||
|
||
let emailSent = await sendWelcome({ sender, emails }); | ||
return NextResponse.json(emailSent); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// app/providers.tsx | ||
"use client"; | ||
import posthog from "posthog-js"; | ||
import { PostHogProvider } from "posthog-js/react"; | ||
import { usePathname, useSearchParams } from "next/navigation"; | ||
import { useEffect } from "react"; | ||
|
||
if (typeof window !== "undefined") { | ||
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, { | ||
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST, | ||
}); | ||
} | ||
|
||
export function PostHogPageview(): JSX.Element { | ||
const pathname = usePathname(); | ||
const searchParams = useSearchParams(); | ||
|
||
useEffect(() => { | ||
if (pathname) { | ||
let url = window.origin + pathname; | ||
if (searchParams && searchParams.toString()) { | ||
url = url + `?${searchParams.toString()}`; | ||
} | ||
posthog.capture("$pageview", { | ||
$current_url: url, | ||
}); | ||
} | ||
}, [pathname, searchParams]); | ||
|
||
return <></>; | ||
} | ||
|
||
export function PHProvider({ children }: { children: React.ReactNode }) { | ||
return <PostHogProvider client={posthog}>{children}</PostHogProvider>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6eafdab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
watermelon – ./
watermelon-git-main-watermelontools.vercel.app
watermelon-watermelontools.vercel.app
watermelon-nine.vercel.app
app.watermelontools.com