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 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user