revert 99397e774c
revert WIP: implement public file visibility feature and enhance search functionality
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user