mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 21:16:49 +00:00
refactor: rename config table to system_config
This commit is contained in:
parent
a0d2773ef4
commit
fc7a6357c0
4 changed files with 10 additions and 10 deletions
|
|
@ -1,23 +0,0 @@
|
|||
using SqlKata;
|
||||
|
||||
namespace PluralKit.Core;
|
||||
|
||||
public partial class ModelRepository
|
||||
{
|
||||
public Task<SystemConfig> GetSystemConfig(SystemId system, IPKConnection conn = null)
|
||||
=> _db.QueryFirst<SystemConfig>(conn, new Query("config").Where("system", system));
|
||||
|
||||
public async Task<SystemConfig> UpdateSystemConfig(SystemId system, SystemConfigPatch patch, IPKConnection conn = null)
|
||||
{
|
||||
var query = patch.Apply(new Query("config").Where("system", system));
|
||||
var config = await _db.QueryFirst<SystemConfig>(conn, query, "returning *");
|
||||
|
||||
_ = _dispatch.Dispatch(system, new UpdateDispatchData
|
||||
{
|
||||
Event = DispatchEvent.UPDATE_SETTINGS,
|
||||
EventData = patch.ToJson()
|
||||
});
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue