feat: add extensive test suite

This commit is contained in:
2026-08-30 11:33:53 +07:00 Unverified
parent 061cce00dc
commit 8359c7272e
131 changed files with 8717 additions and 2200 deletions
+8 -5
View File
@@ -3,11 +3,14 @@
import { adminCheck } from "@/lib/auth";
import { db } from "@/lib/db";
import { cdn } from "@/lib/db/schema";
import { listFilesService } from "./service";
export async function listFiles() {
if (!(await adminCheck())) throw "Unauthorized";
return await db
.select({ id: cdn.id, name: cdn.name, size: cdn.size, type: cdn.type })
.from(cdn);
return listFilesService({
adminCheck,
list: () =>
db
.select({ id: cdn.id, name: cdn.name, size: cdn.size, type: cdn.type })
.from(cdn),
});
}