Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 0 additions & 230 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"lint": "eslint"
},
"dependencies": {
"@xyflow/react": "^12.10.1",
"highlight.js": "^11.11.1",
"marked": "^17.0.3",
"next": "16.1.6",
Expand Down
31 changes: 31 additions & 0 deletions src/app/api/sessions/[sessionId]/permanent-delete/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { NextRequest, NextResponse } from "next/server";
import fs from "fs/promises";
import path from "path";

export async function DELETE(
req: NextRequest,
{ params }: { params: Promise<{ sessionId: string }> }
) {
const { sessionId } = await params;
const body = await req.json().catch(() => ({}));
const filePath = body.filePath as string | undefined;

if (!filePath) {
return NextResponse.json({ error: "filePath required" }, { status: 400 });
}

if (!filePath.includes(sessionId)) {
return NextResponse.json({ error: "session/path mismatch" }, { status: 400 });
}

// The file should be in .trash/ — permanently remove it
const trashPath = path.join(path.dirname(filePath), ".trash", path.basename(filePath));

try {
await fs.rm(trashPath, { force: true });
return NextResponse.json({ ok: true });
} catch {
// Maybe file was already removed or never existed in trash
return NextResponse.json({ ok: true });
}
}
Loading