revert WIP: implement public file visibility feature and enhance search functionality
This commit is contained in:
2025-05-09 08:55:45 +00:00
parent 99397e774c
commit b63e3ae77f
10 changed files with 33 additions and 254 deletions
-22
View File
@@ -1,22 +0,0 @@
import { NextResponse } from "next/server";
import { db } from "~/server/db";
export async function POST(req: Request) {
try {
const { fileId, isPublic } = await req.json();
if (!fileId) {
return NextResponse.json({ error: "File ID is required" }, { status: 400 });
}
await db.file.update({
where: { id: fileId },
data: { public: isPublic },
});
return NextResponse.json({ success: true });
} catch (error) {
console.error("Error updating public status:", error);
return NextResponse.json({ error: "Failed to update public status" }, { status: 500 });
}
}