refactor: getTeamMemberTE function removed

This commit is contained in:
mirarifhasan
2024-04-29 22:33:11 +06:00
parent 9694c0d373
commit 5eed5ce176
2 changed files with 3 additions and 16 deletions

View File

@@ -319,11 +319,11 @@ export class AdminService {
const user = await this.userService.findUserByEmail(userEmail);
if (O.isNone(user)) return E.left(USER_NOT_FOUND);
const teamMember = await this.teamService.getTeamMemberTE(
const teamMember = await this.teamService.getTeamMember(
teamID,
user.value.uid,
)();
if (E.isLeft(teamMember)) {
);
if (!teamMember) {
const addedUser = await this.teamService.addMemberToTeamWithEmail(
teamID,
userEmail,

View File

@@ -362,19 +362,6 @@ export class TeamService implements UserDataHandler, OnModuleInit {
}
}
getTeamMemberTE(teamID: string, userUid: string) {
return pipe(
() => this.getTeamMember(teamID, userUid),
TE.fromTask,
TE.chain(
TE.fromPredicate(
(x): x is TeamMember => !!x,
() => TEAM_MEMBER_NOT_FOUND,
),
),
);
}
async getRoleOfUserInTeam(
teamID: string,
userUid: string,