重构大量文件

This commit is contained in:
2026-02-24 10:50:11 +08:00
parent dd97cf6a2c
commit 9efdf060f5
29 changed files with 264 additions and 133 deletions
+3 -4
View File
@@ -6,8 +6,7 @@ export async function PUT(req: Request) {
try {
const { currentPassword, newPassword } = await req.json();
// Cast to any to bypass build error until server restart allows prisma generate to run
const settings = await (prisma as any).globalSettings.findUnique({
const settings = await prisma.globalSettings.findUnique({
where: { id: "default" },
});
@@ -22,13 +21,13 @@ export async function PUT(req: Request) {
const hashedPassword = await hashPassword(newPassword);
await (prisma as any).globalSettings.update({
await prisma.globalSettings.update({
where: { id: "default" },
data: { password: hashedPassword },
});
return NextResponse.json({ success: true });
} catch (error) {
} catch {
return NextResponse.json({ error: "Failed to change password" }, { status: 500 });
}
}