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/index.js CHANGED
@@ -278,8 +278,7 @@ var MemoryAdapter = class {
278
278
  async getInstancesByApprover(tenantId, approverId, opts) {
279
279
  const all = [...this.instances.values()].filter((i) => {
280
280
  if (i.tenantId !== tenantId || i.status !== "pending") return false;
281
- const currentLevel = i.levels.find((l) => l.level === i.currentLevel);
282
- return currentLevel?.approverIds.includes(approverId) ?? false;
281
+ return i.levels.some((l) => l.status === "pending" && l.approverIds.includes(approverId));
283
282
  });
284
283
  return paginate(
285
284
  all.map((i) => reviveDates(deepClone(i))),