hierarchical-approval 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/nestjs.cjs CHANGED
@@ -285,8 +285,7 @@ var MemoryAdapter = class {
285
285
  async getInstancesByApprover(tenantId, approverId, opts) {
286
286
  const all = [...this.instances.values()].filter((i) => {
287
287
  if (i.tenantId !== tenantId || i.status !== "pending") return false;
288
- const currentLevel = i.levels.find((l) => l.level === i.currentLevel);
289
- return currentLevel?.approverIds.includes(approverId) ?? false;
288
+ return i.levels.some((l) => l.status === "pending" && l.approverIds.includes(approverId));
290
289
  });
291
290
  return paginate(
292
291
  all.map((i) => reviveDates(deepClone(i))),