2020-11-20 23:34:08 +00:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
2021-09-30 01:51:38 +00:00
|
|
|
using SqlKata;
|
2020-11-20 23:34:08 +00:00
|
|
|
|
|
|
|
namespace PluralKit.Core
|
|
|
|
{
|
|
|
|
public partial class ModelRepository
|
|
|
|
{
|
2021-09-30 01:51:38 +00:00
|
|
|
public async Task UpdateAccount(ulong id, AccountPatch patch)
|
2020-11-20 23:34:08 +00:00
|
|
|
{
|
|
|
|
_logger.Information("Updated account {accountId}: {@AccountPatch}", id, patch);
|
2021-09-30 01:51:38 +00:00
|
|
|
var query = patch.Apply(new Query("accounts").Where("uid", id));
|
2021-11-19 16:37:50 +00:00
|
|
|
_ = _dispatch.Dispatch(id, patch);
|
2021-10-03 16:02:26 +00:00
|
|
|
await _db.ExecuteQuery(query, extraSql: "returning *");
|
2020-11-20 23:34:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|