PluralKit/PluralKit.Core/Database/Repository/ModelRepository.Account.cs

16 lines
455 B
C#
Raw Normal View History

2020-11-20 23:34:08 +00:00
using System.Threading.Tasks;
using SqlKata;
2020-11-20 23:34:08 +00:00
namespace PluralKit.Core
{
public partial class ModelRepository
{
public async Task UpdateAccount(ulong id, AccountPatch patch)
2020-11-20 23:34:08 +00:00
{
_logger.Information("Updated account {accountId}: {@AccountPatch}", id, patch);
var query = patch.Apply(new Query("accounts").Where("uid", id));
await _db.ExecuteQuery(query, extraSql: "returning *");
2020-11-20 23:34:08 +00:00
}
}
}