Files
calendar/packages/trpc/server/routers/viewer/teams/listInvites.handler.ts
T
7f23ae156b fix: improved team upgrade screen to also show unpublished teams (#12492)
* improved team upgrade screen to also show unpublished teams

* Update TeamsListing.tsx

* bunch of stuff

---------

Co-authored-by: Omar López <zomars@me.com>
2023-11-29 14:48:26 -07:00

23 lines
473 B
TypeScript

import { prisma } from "@calcom/prisma";
import type { TrpcSessionUser } from "@calcom/trpc/server/trpc";
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;