-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add missions flow and safety layer #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mikepsinn
wants to merge
18
commits into
main
Choose a base branch
from
feature/dating-safety-layer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
63418b9
feat(dating): add dating safety acknowledgment functions and constants
mikepsinn 7401fc8
Move dating flow to missions
mikepsinn 2487e04
feat(parameters): add new parameters related to human laughter and sh…
mikepsinn 708f882
Document campaign nonprofit identity
mikepsinn 1c5859c
Use campaign nonprofit in legal copy
mikepsinn f54f4c3
Move missions into shared profile flows
mikepsinn 4e2c9cd
Address missions review findings
mikepsinn f97fe61
Use parameter value on missions page
mikepsinn db56645
Map mission profile safety errors
mikepsinn 14501a6
Add /joke — actionable prankster page extracted from joke.qmd
mikepsinn 42bb149
Fix joke copy affordance and homepage retry
mikepsinn 746787d
Reduce auth signup spam side effects
mikepsinn 3faffbe
Add MCP task template tools
mikepsinn 86e2752
Wait for visual review page before posting status
mikepsinn cd4348a
Rebuild /joke with printable handout; wire Microsoft Clarity; extract…
mikepsinn cb26530
Joke page polish (Mike-authored)
mikepsinn c36f8b6
feat: Improve the joke page and. replace PosterQrCode with CampaignQr…
mikepsinn b2d75ff
Add MCP improvements plan; update joke-handout draft
mikepsinn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
183 changes: 180 additions & 3 deletions
183
packages/data/src/parameters/parameters-calculations-citations.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,40 @@ | ||
| import { DatingBlockScope } from "@optimitron/db"; | ||
| import { NextResponse } from "next/server"; | ||
| import { z } from "zod"; | ||
| import { requireAuth } from "@/lib/auth-utils"; | ||
| import { createDatingBlock } from "@/lib/dating.server"; | ||
|
|
||
| export const runtime = "nodejs"; | ||
|
|
||
| const BlockBodySchema = z.object({ | ||
| blockedProfileId: z.string().min(1).max(120), | ||
| reason: z.string().max(500).nullish(), | ||
| scope: z.nativeEnum(DatingBlockScope).optional(), | ||
| }); | ||
|
|
||
| export async function POST(request: Request) { | ||
| try { | ||
| const { userId } = await requireAuth(); | ||
| const parsed = BlockBodySchema.parse(await request.json()); | ||
| const block = await createDatingBlock(userId, parsed); | ||
| return NextResponse.json({ block, success: true }); | ||
| } catch (error) { | ||
| if (error instanceof Error && error.message === "Unauthorized") { | ||
| return NextResponse.json({ error: "Unauthorized" }, { status: 401 }); | ||
| } | ||
| if (error instanceof z.ZodError) { | ||
| return NextResponse.json( | ||
| { error: "Invalid dating block." }, | ||
| { status: 400 }, | ||
| ); | ||
| } | ||
| if (error instanceof Error) { | ||
| return NextResponse.json({ error: error.message }, { status: 400 }); | ||
| } | ||
| console.error("[dating] Failed to block profile:", error); | ||
| return NextResponse.json( | ||
| { error: "Failed to block dating profile." }, | ||
| { status: 500 }, | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.