feat: import/export system config

This commit is contained in:
spiral
2021-11-30 17:04:42 -05:00
parent 9097142718
commit cc4e659cec
6 changed files with 30 additions and 9 deletions

View File

@@ -21,7 +21,7 @@ public class DataFileService
_dispatch = dispatch;
}
public async Task<JObject> ExportSystem(PKSystem system, string timezone)
public async Task<JObject> ExportSystem(PKSystem system)
{
await using var conn = await _db.Obtain();
@@ -30,7 +30,9 @@ public class DataFileService
o.Merge(system.ToJson(LookupContext.ByOwner));
o.Add("timezone", timezone);
var config = await _repo.GetSystemConfig(system.Id);
o.Add("config", config.ToJson());
o.Add("accounts", new JArray((await _repo.GetSystemAccounts(system.Id)).ToList()));
o.Add("members",
new JArray((await _repo.GetSystemMembers(system.Id).ToListAsync()).Select(m =>