feat: add Ko-fi donations tab to admin dashboard

This commit is contained in:
2026-04-23 13:29:15 -04:00
parent ed7f1dd114
commit 70a1925c95
3 changed files with 110 additions and 16 deletions
+21 -3
View File
@@ -1,13 +1,13 @@
import { Router } from "express";
import { io } from "../index";
import {
type AuthenticatedRequest,
authenticate,
AuthenticatedRequest,
requireAdmin,
} from "../middleware/auth";
import { prisma } from "../utils/prisma";
import { asyncHandler } from "../middleware/errorHandler";
import { io } from "../index";
import { backfillUserHistory } from "../services/tautulli";
import { prisma } from "../utils/prisma";
const router = Router();
@@ -229,4 +229,22 @@ router.get(
}),
);
router.get(
"/kofi-payments",
authenticate,
requireAdmin,
asyncHandler(async (_req: AuthenticatedRequest, res) => {
const payments = await prisma.kofiPayment.findMany({
orderBy: { createdAt: "desc" },
take: 100,
include: {
user: {
select: { plexUsername: true },
},
},
});
res.json({ payments });
}),
);
export { router as adminRouter };