PluralKit/PluralKit.Core/Database/Repository/ModelRepository.Account.cs
spiral 502265973c
fix: explicitly return * in Patch queries
This is needed because the API takes the object from the database query to return to the user
2021-10-03 12:02:26 -04:00

16 lines
455 B
C#

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