refactor: getTeamMemberTE function removed
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user