fix: dont import directly from @calcom/trpc or @calom/features (#26734)
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
import { ProfileRepository } from "@calcom/features/profile/repositories/ProfileRepository";
|
||||
import type { OrgMembershipLookup } from "@calcom/trpc/server/routers/viewer/slots/util";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
import {
|
||||
type OrgMembershipLookup,
|
||||
ProfileRepository,
|
||||
} from "@calcom/platform-libraries";
|
||||
|
||||
/**
|
||||
* NestJS service that implements OrgMembershipLookup interface.
|
||||
* Wraps ProfileRepository's static method for DI compatibility.
|
||||
*/
|
||||
@Injectable()
|
||||
export class OrgMembershipLookupService implements OrgMembershipLookup {
|
||||
async findFirstOrganizationIdForUser({ userId }: { userId: number }): Promise<number | null> {
|
||||
async findFirstOrganizationIdForUser({
|
||||
userId,
|
||||
}: {
|
||||
userId: number;
|
||||
}): Promise<number | null> {
|
||||
return ProfileRepository.findFirstOrganizationIdForUser({ userId });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/crede
|
||||
import { paymentDataSelect } from "@calcom/prisma/selects/payment";
|
||||
import { createNewUsersConnectToOrgIfExists } from "@calcom/trpc/server/routers/viewer/teams/inviteMember/utils";
|
||||
|
||||
|
||||
export { slugify } from "@calcom/lib/slugify";
|
||||
export { slugifyLenient } from "@calcom/lib/slugify-lenient";
|
||||
export { getBookingForReschedule };
|
||||
@@ -141,3 +142,6 @@ export { validateUrlForSSRFSync } from "@calcom/lib/ssrfProtection";
|
||||
export { verifyCodeChallenge } from "@calcom/lib/pkce";
|
||||
export { generateSecret } from "@calcom/features/oauth/utils/generateSecret";
|
||||
export { OAuthService } from "@calcom/features/oauth/services/OAuthService";
|
||||
|
||||
export { ProfileRepository } from "@calcom/features/profile/repositories/ProfileRepository";
|
||||
export type { OrgMembershipLookup } from "@calcom/trpc/server/routers/viewer/slots/util";
|
||||
Reference in New Issue
Block a user