fix/ Remove `getUserAdminTeams` endpoint (#10648)
parent
e907ac8a9a
commit
bee5011ec1
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
import { z } from "zod";
|
||||
|
||||
export const ZGetUserAdminTeamsInputSchema = z.object({
|
||||
getUserInfo: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export type TGetUserAdminTeamsInputSchema = z.infer<typeof ZGetUserAdminTeamsInputSchema>;
|
Loading…
Reference in New Issue