BUGFIX: Remove redundant GET function for file retrieval

This commit is contained in:
2025-09-16 11:29:19 +02:00
parent 06599c844a
commit e5e72b597a

View File

@@ -100,30 +100,3 @@ export async function DELETE(request, { params }) {
);
}
}
export async function GET(request, { params }) {
try {
const fileId = params.fileId;
// Get file info from database
const file = db.prepare(`
SELECT * FROM file_attachments WHERE file_id = ?
`).get(parseInt(fileId));
if (!file) {
return NextResponse.json(
{ error: "File not found" },
{ status: 404 }
);
}
return NextResponse.json(file);
} catch (error) {
console.error("Error fetching file:", error);
return NextResponse.json(
{ error: "Failed to fetch file" },
{ status: 500 }
);
}
}