moduledefinition settings and host settings
This commit is contained in:
@ -21,6 +21,7 @@ namespace Oqtane.Services
|
||||
}
|
||||
|
||||
private string Apiurl => CreateApiUrl("Setting", _siteState.Alias);
|
||||
|
||||
public async Task<Dictionary<string, string>> GetTenantSettingsAsync()
|
||||
{
|
||||
return await GetSettingsAsync(EntityNames.Tenant, -1);
|
||||
@ -101,6 +102,16 @@ namespace Oqtane.Services
|
||||
await UpdateSettingsAsync(folderSettings, EntityNames.Folder, folderId);
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string, string>> GetHostSettingsAsync()
|
||||
{
|
||||
return await GetSettingsAsync(EntityNames.Host, -1);
|
||||
}
|
||||
|
||||
public async Task UpdateHostSettingsAsync(Dictionary<string, string> hostSettings)
|
||||
{
|
||||
await UpdateSettingsAsync(hostSettings, EntityNames.Host, -1);
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string, string>> GetSettingsAsync(string entityName, int entityId)
|
||||
{
|
||||
var dictionary = new Dictionary<string, string>();
|
||||
@ -154,9 +165,9 @@ namespace Oqtane.Services
|
||||
}
|
||||
|
||||
|
||||
public async Task<Setting> GetSettingAsync(int settingId)
|
||||
public async Task<Setting> GetSettingAsync(string entityName, int settingId)
|
||||
{
|
||||
return await GetJsonAsync<Setting>($"{Apiurl}/{settingId}");
|
||||
return await GetJsonAsync<Setting>($"{Apiurl}/{settingId}/{entityName}");
|
||||
}
|
||||
|
||||
public async Task<Setting> AddSettingAsync(Setting setting)
|
||||
@ -169,9 +180,9 @@ namespace Oqtane.Services
|
||||
return await PutJsonAsync<Setting>($"{Apiurl}/{setting.SettingId}", setting);
|
||||
}
|
||||
|
||||
public async Task DeleteSettingAsync(int settingId)
|
||||
public async Task DeleteSettingAsync(string entityName, int settingId)
|
||||
{
|
||||
await DeleteAsync($"{Apiurl}/{settingId}");
|
||||
await DeleteAsync($"{Apiurl}/{settingId}/{entityName}");
|
||||
}
|
||||
|
||||
|
||||
@ -230,5 +241,19 @@ namespace Oqtane.Services
|
||||
}
|
||||
return settings1;
|
||||
}
|
||||
|
||||
[Obsolete("GetSettingAsync(int settingId) is deprecated. Use GetSettingAsync(string entityName, int settingId) instead.", false)]
|
||||
public async Task<Setting> GetSettingAsync(int settingId)
|
||||
{
|
||||
return await GetJsonAsync<Setting>($"{Apiurl}/{settingId}/tenant");
|
||||
}
|
||||
|
||||
[Obsolete("DeleteSettingAsync(int settingId) is deprecated. Use DeleteSettingAsync(string entityName, int settingId) instead.", false)]
|
||||
public async Task DeleteSettingAsync(int settingId)
|
||||
{
|
||||
await DeleteAsync($"{Apiurl}/{settingId}/tenant");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user