Fixed bugs when users update their patreon pledge. Updated some packages

This commit is contained in:
Kwoth
2022-06-15 13:11:27 +02:00
parent 5fbe93d898
commit e9923a7691
8 changed files with 95 additions and 97 deletions

View File

@@ -75,19 +75,4 @@ public sealed class BankService : IBankService, INService
?.Balance
?? 0;
}
public async Task<long> BurnAllAsync(ulong userId)
{
await using var ctx = _db.GetDbContext();
var output = await ctx.GetTable<BankUser>()
.Where(x => x.UserId == userId)
.UpdateWithOutputAsync(old => new()
{
Balance = 0
});
if (output.Length == 0)
return 0;
return output[0].Deleted.Balance;
}
}

View File

@@ -5,5 +5,4 @@ public interface IBankService
Task<bool> DepositAsync(ulong userId, long amount);
Task<bool> WithdrawAsync(ulong userId, long amount);
Task<long> GetBalanceAsync(ulong userId);
Task<long> BurnAllAsync(ulong userId);
}