mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 06:15:39 -04:00
- Delete lib/api/errors.ts and lib/api/auth-guard.ts, inline NextResponse.json() error responses directly in route handlers - Replace non-standard amber CSS variables with primary/primary-foreground - Regenerate shadcn UI components with biome-ignore comments - Add CLAUDE.md for repository guidance - Update dependencies and pnpm lockfile Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18 lines
620 B
TypeScript
18 lines
620 B
TypeScript
import { headers } from "next/headers";
|
|
import type { NextRequest } from "next/server";
|
|
import { NextResponse } from "next/server";
|
|
import { auth } from "@/lib/auth/server";
|
|
import { getNewAvailableFeed } from "@/lib/services/discovery";
|
|
|
|
export async function GET(req: NextRequest) {
|
|
const session = await auth.api.getSession({
|
|
headers: await headers(),
|
|
});
|
|
if (!session)
|
|
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
|
|
|
const days = Number(req.nextUrl.searchParams.get("days") ?? 14);
|
|
const feed = getNewAvailableFeed(session.user.id, days);
|
|
return NextResponse.json(feed);
|
|
}
|