feat: update collaborator invitation flow to handle existing users and pending invitations in StepEngine
This commit is contained in:
@@ -167,7 +167,11 @@ class EmployeeManager implements IEmployeesManager {
|
||||
}
|
||||
|
||||
if (employeeCheck) {
|
||||
throw new Error("El usuario ya pertenece a la compañia");
|
||||
if (!employeeCheck.guestOk) {
|
||||
throw new Error("La invitación para este usuario ya está pendiente");
|
||||
}
|
||||
|
||||
throw new Error("El usuario ya pertenece a la compañía");
|
||||
}
|
||||
|
||||
const canAdd = await MetricsList.canAddEmployee(companyCheck.ownerId);
|
||||
|
||||
Reference in New Issue
Block a user