feat: add thread status documents and safe thread reply handling

This commit is contained in:
kris
2026-04-04 11:50:46 +08:00
parent 010d8eda2d
commit 4d9b8e2976
10 changed files with 487 additions and 57 deletions

View File

@@ -1,6 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import { requireRequestSession } from "@/lib/boss-auth";
import { readState } from "@/lib/boss-data";
import { getProjectDetailView } from "@/lib/boss-projections";
export async function GET(
request: NextRequest,
@@ -13,8 +14,8 @@ export async function GET(
const { projectId } = await context.params;
const state = await readState();
const project = state.projects.find((item) => item.id === projectId);
if (!project) {
const detail = getProjectDetailView(state, projectId, session.account);
if (!detail) {
return NextResponse.json({ ok: false, message: "PROJECT_NOT_FOUND" }, { status: 404 });
}