* move SystemField to features * migrate workflow service * merge two tests for team repository * update imports and migrate team repository * migrate delegation credential repository * migrate credential repository * migrate entityPermissionUtils * migrate hashedLink service and repository * migrate membership service * update imports * remove file * migrate buildEventUrlFromBooking * migrate getAllUserBookings to features * update imports * update organizationMock * migrate slots * migrate date-ranges to schedules dir * migrate getAggregatedAvailability * fix * refactor * migrate useCreateEventType hook to features * migrate assignValueToUser * migrate validateUsername to auth features * migrate system field back to lib * migrate getLabelValueMapFromResponses back to lib * update imports * use relative path * fix type checks * fix * fix * fix tests * update gh codeowners * fix * fix
23 lines
592 B
TypeScript
23 lines
592 B
TypeScript
import { TeamRepository } from "@calcom/features/ee/teams/repositories/TeamRepository";
|
|
import prisma from "@calcom/prisma";
|
|
|
|
import type { TrpcSessionUser } from "../../../types";
|
|
import type { TGetListSchema } from "./list.schema";
|
|
|
|
type ListOptions = {
|
|
ctx: {
|
|
user: NonNullable<TrpcSessionUser>;
|
|
};
|
|
input: TGetListSchema;
|
|
};
|
|
|
|
export const listHandler = async ({ ctx, input }: ListOptions) => {
|
|
const teamRepo = new TeamRepository(prisma);
|
|
return teamRepo.findTeamsByUserId({
|
|
userId: ctx.user.id,
|
|
includeOrgs: input?.includeOrgs,
|
|
});
|
|
};
|
|
|
|
export default listHandler;
|