mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
feat(types/prisma): implement getTestcaseWithData with TestcaseWithData type
This commit is contained in:
parent
1813d4ed79
commit
e6614a0aa2
10
src/types/prisma.ts
Normal file
10
src/types/prisma.ts
Normal file
@ -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>>;
|
Loading…
Reference in New Issue
Block a user