feat(transactions): UI updates

by @negue
This commit is contained in:
SabreCat
2022-11-15 19:28:36 -06:00
parent 1a5cba57b7
commit 259131ee3f
8 changed files with 350 additions and 86 deletions

View File

@@ -267,7 +267,7 @@ api.updateHero = {
const hero = await User.findById(heroId).exec();
if (!hero) throw new NotFound(res.t('userWithIDNotFound', { userId: heroId }));
if (updateData.balance) {
if (updateData.balance && updateData.balance !== hero.balance) {
await hero.updateBalance(updateData.balance - hero.balance, 'admin_update_balance', '', 'Given by Habitica staff');
hero.balance = updateData.balance;