feat: implement collaborator reactivation logic, add access denied handling, and improve metric filtering
This commit is contained in:
@@ -536,7 +536,8 @@ class CompaniesManager implements ICompaniesManager {
|
||||
const employ = await EmployeesList.employees.findOne({
|
||||
companyId: data.id,
|
||||
userId: String(data.sessionUser),
|
||||
});
|
||||
removed: { $ne: true },
|
||||
} as any);
|
||||
|
||||
if (!employ) {
|
||||
throw new Error("El usuario no participa de la organización");
|
||||
@@ -721,7 +722,8 @@ class CompaniesManager implements ICompaniesManager {
|
||||
//Organizaciones en las que participa como colaborador.
|
||||
const orgCollaborator = await EmployeesList.employees.find({
|
||||
userId: data.sessionUser,
|
||||
});
|
||||
removed: { $ne: true },
|
||||
} as any);
|
||||
|
||||
for (const item of orgCollaborator) {
|
||||
if (item.companyId) {
|
||||
|
||||
Reference in New Issue
Block a user