* improved team upgrade screen to also show unpublished teams * Update TeamsListing.tsx * bunch of stuff --------- Co-authored-by: Omar López <zomars@me.com>
23 lines
473 B
TypeScript
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;
|