From 6633cea5dc22cb0f188ee5f77e0425ef462b3644 Mon Sep 17 00:00:00 2001 From: juliaam Date: Tue, 11 Jun 2024 17:02:41 -0300 Subject: [PATCH] fix: error in methods --- src/components/Vaccine/index.js | 3 ++- src/components/VaccineGroup/index.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Vaccine/index.js b/src/components/Vaccine/index.js index 1e07a5df..58dc22f5 100644 --- a/src/components/Vaccine/index.js +++ b/src/components/Vaccine/index.js @@ -77,10 +77,11 @@ Vaccine.prototype = Object.assign(Vaccine.prototype, Component.prototype, { listVaccines() { const vaccines = []; - this.groups.values().forEach((group) => { + Array.from(this.groups.values()).forEach((group) => { const items = group.listItems(); vaccines.push(...items); }); + return vaccines; }, openDrawer() { diff --git a/src/components/VaccineGroup/index.js b/src/components/VaccineGroup/index.js index b507d7c8..59a9e3a1 100644 --- a/src/components/VaccineGroup/index.js +++ b/src/components/VaccineGroup/index.js @@ -43,7 +43,7 @@ VaccineGroup.prototype = Object.assign( listItems() { const items = []; - this.items.values().forEach((item) => { + Array.from(this.items.values()).forEach((item) => { items.push({ id: item.id, title: item.getTitle(), @@ -51,6 +51,7 @@ VaccineGroup.prototype = Object.assign( date: item.getDate(), }); }); + return items; }, },