Major rework: multi-user accounts (register/login, per-user data isolation), new layout with sidebar/dashboard/profile menu, matrix phase view with collapsible category columns, life timeline with ages per phase, live budget capping, collapsible transitions, mobile support
Deploy App / deploy (push) Successful in 1m47s
Deploy App / deploy (push) Successful in 1m47s
This commit is contained in:
@@ -2,13 +2,18 @@ import { NextRequest, NextResponse } from "next/server";
|
||||
import { z } from "zod";
|
||||
import { prisma } from "@/lib/db";
|
||||
import { getHouseholdOrNull } from "@/lib/queries";
|
||||
import { getCurrentUserId } from "@/lib/session";
|
||||
|
||||
const createPlanSchema = z.object({
|
||||
name: z.string().min(1).max(120),
|
||||
});
|
||||
|
||||
export async function GET() {
|
||||
const household = await getHouseholdOrNull();
|
||||
const userId = await getCurrentUserId();
|
||||
if (!userId) {
|
||||
return NextResponse.json({ error: "Nicht authentifiziert." }, { status: 401 });
|
||||
}
|
||||
const household = await getHouseholdOrNull(userId);
|
||||
if (!household) {
|
||||
return NextResponse.json({ plans: [] });
|
||||
}
|
||||
@@ -31,7 +36,11 @@ export async function GET() {
|
||||
}
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
const household = await getHouseholdOrNull();
|
||||
const userId = await getCurrentUserId();
|
||||
if (!userId) {
|
||||
return NextResponse.json({ error: "Nicht authentifiziert." }, { status: 401 });
|
||||
}
|
||||
const household = await getHouseholdOrNull(userId);
|
||||
if (!household) {
|
||||
return NextResponse.json(
|
||||
{ error: "Bitte zuerst das Grundprofil (Onboarding) anlegen." },
|
||||
|
||||
Reference in New Issue
Block a user