- [All] Finished API call for spells and various bug fixes

This commit is contained in:
Alexis
2020-04-01 19:01:03 +02:00
parent 27a1113bd2
commit 37f4913d3e
9 changed files with 263 additions and 53 deletions

View File

@@ -31,12 +31,12 @@ const getSpells = (params) => {
// Loops over the results to fetch the associated tables
for (let i = 0; i < result.length; i++) {
let currentSpell_ID = i + 1
let currentSpell_ID = result[i].id
// Fetches the spell's schools
let fetchSpellSchoolData = new Promise((resolve, reject) => {
let query =
"SELECT school.name, school.description " +
"SELECT school.name " +
"FROM spells_schools AS sc " +
"INNER JOIN school AS school ON sc.id_school = school.id " +
"WHERE sc.id_spell = " + currentSpell_ID