23 lines
552 B
TypeScript
23 lines
552 B
TypeScript
import { prisma } from "../constants";
|
|
import { Prisma } from "../../generated/prisma/client";
|
|
import {
|
|
buildCollectorFindManyArgs,
|
|
CollectorQueryOptions,
|
|
} from "../helper/collectorQuery";
|
|
|
|
type MemberCollectorOpts = CollectorQueryOptions<
|
|
Prisma.MemberSelect,
|
|
Prisma.MemberInclude
|
|
>;
|
|
|
|
export default async (opts?: MemberCollectorOpts) => {
|
|
const args: Prisma.MemberFindManyArgs = buildCollectorFindManyArgs<
|
|
Prisma.MemberSelect,
|
|
Prisma.MemberInclude
|
|
>(opts);
|
|
|
|
const data = await prisma.member.findMany(args);
|
|
|
|
return data;
|
|
};
|