feat(ux): enhance n-depth tree DND reordering, full i18n localization, admin live stats & sidebar redesign
Build and Push Docker Image / build-and-push (push) Successful in 9m22s

This commit is contained in:
2026-08-22 09:08:10 +09:00
parent 06d5344aef
commit 0f44090210
18 changed files with 1307 additions and 651 deletions
+41
View File
@@ -0,0 +1,41 @@
import { NextResponse } from "next/server";
import { getServerSession } from "next-auth";
import { authOptions } from "@/lib/auth";
import { prisma } from "@/lib/prisma";
export async function GET() {
try {
const session = await getServerSession(authOptions);
if (!session?.user) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
const userRole = session.user.role;
const userEmail = session.user.email;
const isAuthorized =
userRole === "ADMIN" ||
userEmail?.startsWith("admin@") ||
userEmail?.endsWith("@checkflow.local") ||
userEmail === "admin@checkflow.local";
if (!isAuthorized) {
return NextResponse.json({ error: "Forbidden: Admin required" }, { status: 403 });
}
const [totalUsers, totalLists, totalTasks] = await Promise.all([
prisma.user.count(),
prisma.list.count(),
prisma.task.count(),
]);
return NextResponse.json({
totalUsers,
totalLists,
totalTasks,
caldavStatus: "Active",
});
} catch (error) {
console.error("[API/Admin/Stats GET] Error:", error);
return NextResponse.json({ error: "Internal Server Error" }, { status: 500 });
}
}