* fix trpc session circle dep * fixes trpc session cirlce dep * fix relative imports * fix more imports to use types and not trpc * fix exports * Fixed types --------- Co-authored-by: Keith Williams <keithwillcode@gmail.com>
23 lines
474 B
TypeScript
23 lines
474 B
TypeScript
import { prisma } from "@calcom/prisma";
|
|
import type { TrpcSessionUser } from "@calcom/trpc/server/types";
|
|
|
|
type ListInvitesOptions = {
|
|
ctx: {
|
|
user: NonNullable<TrpcSessionUser>;
|
|
};
|
|
};
|
|
|
|
export const listInvitesHandler = async ({ ctx }: ListInvitesOptions) => {
|
|
const userId = ctx.user.id;
|
|
return await prisma.membership.findMany({
|
|
where: {
|
|
user: {
|
|
id: userId,
|
|
},
|
|
accepted: false,
|
|
},
|
|
});
|
|
};
|
|
|
|
export default listInvitesHandler;
|