fix/ Remove `getUserAdminTeams` endpoint (#10648)

pull/10607/head^2
Joe Au-Yeung 2023-08-08 21:10:57 -04:00 committed by GitHub
parent e907ac8a9a
commit bee5011ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 44 deletions

View File

@ -9,7 +9,6 @@ import { ZDeleteInviteInputSchema } from "./deleteInvite.schema";
import { ZGetInputSchema } from "./get.schema";
import { ZGetMemberAvailabilityInputSchema } from "./getMemberAvailability.schema";
import { ZGetMembershipbyUserInputSchema } from "./getMembershipbyUser.schema";
import { ZGetUserAdminTeamsInputSchema } from "./getUserAdminTeams.schema";
import { ZInviteMemberInputSchema } from "./inviteMember/inviteMember.schema";
import { ZInviteMemberByTokenSchemaInputSchema } from "./inviteMemberByToken.schema";
import { ZListMembersInputSchema } from "./listMembers.schema";
@ -38,7 +37,6 @@ type TeamsRouterHandlerCache = {
listMembers?: typeof import("./listMembers.handler").listMembersHandler;
hasTeamPlan?: typeof import("./hasTeamPlan.handler").hasTeamPlanHandler;
listInvites?: typeof import("./listInvites.handler").listInvitesHandler;
getUserAdminTeams?: typeof import("./getUserAdminTeams.handler").getUserAdminTeamsHandler;
createInvite?: typeof import("./createInvite.handler").createInviteHandler;
setInviteExpiration?: typeof import("./setInviteExpiration.handler").setInviteExpirationHandler;
deleteInvite?: typeof import("./deleteInvite.handler").deleteInviteHandler;
@ -363,24 +361,6 @@ export const viewerTeamsRouter = router({
});
}),
getUserAdminTeams: authedProcedure.input(ZGetUserAdminTeamsInputSchema).query(async ({ ctx, input }) => {
if (!UNSTABLE_HANDLER_CACHE.getUserAdminTeams) {
UNSTABLE_HANDLER_CACHE.getUserAdminTeams = await import("./getUserAdminTeams.handler").then(
(mod) => mod.getUserAdminTeamsHandler
);
}
// Unreachable code but required for type safety
if (!UNSTABLE_HANDLER_CACHE.getUserAdminTeams) {
throw new Error("Failed to load handler");
}
return UNSTABLE_HANDLER_CACHE.getUserAdminTeams({
ctx,
input,
});
}),
createInvite: authedProcedure.input(ZCreateInviteInputSchema).mutation(async ({ ctx, input }) => {
if (!UNSTABLE_HANDLER_CACHE.createInvite) {
UNSTABLE_HANDLER_CACHE.createInvite = await import("./createInvite.handler").then(

View File

@ -1,17 +0,0 @@
import getUserAdminTeams from "@calcom/features/ee/teams/lib/getUserAdminTeams";
import type { TrpcSessionUser } from "../../../trpc";
import type { TGetUserAdminTeamsInputSchema } from "./getUserAdminTeams.schema";
type ListOptions = {
ctx: {
user: NonNullable<TrpcSessionUser>;
};
input: TGetUserAdminTeamsInputSchema;
};
export const getUserAdminTeamsHandler = async ({ ctx, input }: ListOptions) => {
const teams = await getUserAdminTeams({ userId: ctx.user.id, getUserInfo: input.getUserInfo });
// TODO display install options for app pages and disable if already installed
return teams;
};

View File

@ -1,7 +0,0 @@
import { z } from "zod";
export const ZGetUserAdminTeamsInputSchema = z.object({
getUserInfo: z.boolean().optional(),
});
export type TGetUserAdminTeamsInputSchema = z.infer<typeof ZGetUserAdminTeamsInputSchema>;