diff --git a/Oqtane.Client/Services/Interfaces/ISettingService.cs b/Oqtane.Client/Services/Interfaces/ISettingService.cs
index 949db56d..dcdc7386 100644
--- a/Oqtane.Client/Services/Interfaces/ISettingService.cs
+++ b/Oqtane.Client/Services/Interfaces/ISettingService.cs
@@ -179,6 +179,17 @@ namespace Oqtane.Services
///
Task UpdateSettingsAsync(Dictionary settings, string entityName, int entityId);
+ ///
+ /// Updates setting for a given entityName and Id
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task AddOrUpdateSettingAsync(string entityName, int entityId, string settingName, string settingValue, bool isPrivate);
+
///
/// Returns a specific setting
///
diff --git a/Oqtane.Client/Services/SettingService.cs b/Oqtane.Client/Services/SettingService.cs
index a138bbb9..5176da7a 100644
--- a/Oqtane.Client/Services/SettingService.cs
+++ b/Oqtane.Client/Services/SettingService.cs
@@ -12,7 +12,7 @@ namespace Oqtane.Services
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class SettingService : ServiceBase, ISettingService
{
- public SettingService(HttpClient http, SiteState siteState) : base(http, siteState) { }
+ public SettingService(HttpClient http, SiteState siteState) : base(http, siteState) {}
private string Apiurl => CreateApiUrl("Setting");
@@ -134,7 +134,7 @@ namespace Oqtane.Services
public async Task> GetSettingsAsync(string entityName, int entityId)
{
var dictionary = new Dictionary();
- var settings = await GetJsonAsync>($"{Apiurl}?entityname={entityName}&entityid={entityId}");
+ var settings = await GetSettingsAsync(entityName, entityId, "");
if (settings != null)
{
foreach (Setting setting in settings.OrderBy(item => item.SettingName).ToList())
@@ -147,7 +147,7 @@ namespace Oqtane.Services
public async Task UpdateSettingsAsync(Dictionary settings, string entityName, int entityId)
{
- var settingsList = await GetJsonAsync>($"{Apiurl}?entityname={entityName}&entityid={entityId}");
+ var settingsList = await GetSettingsAsync(entityName, entityId, "");
foreach (KeyValuePair kvp in settings)
{
@@ -192,14 +192,14 @@ namespace Oqtane.Services
}
}
+ public async Task AddOrUpdateSettingAsync(string entityName, int entityId, string settingName, string settingValue, bool isPrivate)
+ {
+ await PutJsonAsync