From 5d466ce4d8b1d2a1a3f0dc7f53be9cbc55dc3511 Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Thu, 21 May 2020 11:53:55 +0200 Subject: [PATCH] - [API] Fixed the loop of getSpells() --- database/spellsaurus_db_data.sql | 2 +- routes/spells.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/database/spellsaurus_db_data.sql b/database/spellsaurus_db_data.sql index 4afcf18..1798f9a 100644 --- a/database/spellsaurus_db_data.sql +++ b/database/spellsaurus_db_data.sql @@ -41,7 +41,7 @@ INSERT INTO `school` (name, description, id_meta_school) VALUES -- SPELLS /* SCHEMA -(id, name, description, level, charge, cost), +(name, description, level, charge, cost, is_ritual), */ -- LIGHT SPELLS diff --git a/routes/spells.js b/routes/spells.js index 1090b99..156f77c 100644 --- a/routes/spells.js +++ b/routes/spells.js @@ -38,11 +38,12 @@ const getSpells = () => { for (let i = 0; i < result.length; i++) { try { result[i] = await buildSpell(result[i]) - resolve(result) } catch (err) { reject(err) } } + console.log(result) + resolve(result) }) }) }