Skip to content

Commit

Permalink
add spell fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
HarmlessHarm committed Jun 2, 2023
1 parent 30029b6 commit 26164c9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/ImportContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export default {
: this.get_spell({ uid: this.uid, id });
},
async addItem(item) {
this.type === "npcs" ? await this.add_npc(item) : await this.add_spell(item);
this.type === "npcs" ? await this.add_npc(item) : await this.add_spell({ spell: item });
},
async editItem(id, item) {
this.type === "npcs"
Expand Down
2 changes: 1 addition & 1 deletion src/services/spells.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class SpellServices {
if (predefined_key) {
await SPELLS_REF.child(uid).child(predefined_key).set(spell);
} else {
newSpell = await SPELLS_REF.child(uid).push(spell);
const newSpell = await SPELLS_REF.child(uid).push(spell);
spell_key = newSpell.key;
}

Expand Down
1 change: 1 addition & 0 deletions src/store/modules/userContent/spells.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ const spell_actions = {
return "Not enough slots";
}
try {
console.log(spell);
const search_spell = convert_spell(spell);
const id = await services.addSpell(uid, spell, search_spell, predefined_key);
commit("SET_SPELL", { id, search_spell });
Expand Down
2 changes: 1 addition & 1 deletion src/views/UserContent/Spells/EditSpell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default {
},
addSpell() {
console.log(this.spell);
this.add_spell(this.spell)
this.add_spell({ spell: this.spell })
.then((key) => {
// Set the spellId, so we know there is an existing spell
// even though we are on the AddSpell route, this we won't create multiple when hitting save again
Expand Down

0 comments on commit 26164c9

Please sign in to comment.