2021-09-29 21:51:38 -04:00
|
|
|
using SqlKata;
|
2020-11-20 18:34:08 -05:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
namespace PluralKit.Core;
|
|
|
|
|
|
|
|
public partial class ModelRepository
|
2020-11-20 18:34:08 -05:00
|
|
|
{
|
2021-11-26 21:10:56 -05:00
|
|
|
public async Task UpdateAccount(ulong id, AccountPatch patch)
|
2020-11-20 18:34:08 -05:00
|
|
|
{
|
2021-11-26 21:10:56 -05:00
|
|
|
_logger.Information("Updated account {accountId}: {@AccountPatch}", id, patch);
|
|
|
|
var query = patch.Apply(new Query("accounts").Where("uid", id));
|
|
|
|
_ = _dispatch.Dispatch(id, patch);
|
|
|
|
await _db.ExecuteQuery(query, "returning *");
|
2020-11-20 18:34:08 -05:00
|
|
|
}
|
|
|
|
}
|