Skip to content

Commit

Permalink
fix bug buy rune
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin-Morette committed May 22, 2024
1 parent 6497971 commit d714844
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion backend/src/controllers/PokemonController.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class PokemonController {
const zone = req.body.nameZone;
const type = req.body.spawnType;
const pokemonName = req.body.namePokemon;

try {
let pokemonData;

Expand Down
1 change: 0 additions & 1 deletion backend/src/controllers/RuneTrainerController.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class RuneTrainerController {
const runeTrainer = {
idTrainer,
idPokemon: rowPokemon[0].id,
isShiny: 0,
};
models.rune_trainer.insert(runeTrainer, quantity);
res
Expand Down
4 changes: 2 additions & 2 deletions backend/src/models/RuneTrainerManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class RuneTrainerManager extends AbstractManager {

insert(rune, quantity = 1) {
return this.connection.query(
`insert into ${RuneTrainerManager.table} (idPokemon, idTrainer, isShiny, quantity) values (?, ?, ?, ?)
`insert into ${RuneTrainerManager.table} (idPokemon, idTrainer, quantity) values (?, ?, ?)
ON DUPLICATE KEY UPDATE quantity = quantity + ?;`,
[rune.idPokemon, rune.idTrainer, rune.isShiny, quantity, quantity]
[rune.idPokemon, rune.idTrainer, quantity, quantity]
);
}

Expand Down

0 comments on commit d714844

Please sign in to comment.