mirror of
https://github.com/massbug/judge4c.git
synced 2026-10-15 15:17:31 +00:00
feat(types/prisma): implement getTestcaseWithData with TestcaseWithData type
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import prisma from "@/lib/prisma";
|
||||
|
||||
type ThenArg<T> = T extends PromiseLike<infer U> ? U : T;
|
||||
|
||||
export async function getTestcaseWithData() {
|
||||
const testcases = await prisma.testcase.findMany({ include: { data: true } });
|
||||
return testcases;
|
||||
}
|
||||
|
||||
export type TestcaseWithData = ThenArg<ReturnType<typeof getTestcaseWithData>>;
|
||||
Reference in New Issue
Block a user