feat: add thread status documents and safe thread reply handling
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user