This commit is contained in:
tidusjar 2017-08-23 22:01:32 +01:00
parent ba2fd48067
commit d7f0f61ece
8 changed files with 31 additions and 20 deletions

View file

@ -40,7 +40,7 @@ namespace Ombi.Settings.Settings
public async Task<T> GetSettingsAsync()
{
var result = await Repo.GetAsync(EntityName).ConfigureAwait(false);
var result = await Repo.GetAsync(EntityName);
if (result == null)
{
return new T();
@ -94,8 +94,8 @@ namespace Ombi.Settings.Settings
modified.Id = entity.Id;
var globalSettings = new GlobalSettings { SettingsName = EntityName, Content = JsonConvert.SerializeObject(modified, SerializerSettings.Settings), Id = entity.Id };
entity.Content = EncryptSettings(globalSettings);
await Repo.UpdateAsync(entity).ConfigureAwait(false);
globalSettings.Content = EncryptSettings(globalSettings);
await Repo.UpdateAsync(globalSettings).ConfigureAwait(false);
return true;
}
@ -117,7 +117,7 @@ namespace Ombi.Settings.Settings
{
await Repo.DeleteAsync(entity);
}
}
private string EncryptSettings(GlobalSettings settings)