ability to specify if a theme is enabled for a site

This commit is contained in:
sbwalker
2023-05-24 13:09:10 -04:00
parent 666f9c2db9
commit 98c2f012ee
23 changed files with 564 additions and 231 deletions

View File

@ -20,6 +20,10 @@ namespace Oqtane.Services
List<Theme> themes = await GetJsonAsync<List<Theme>>(ApiUrl);
return themes.OrderBy(item => item.Name).ToList();
}
public async Task<Theme> GetThemeAsync(int themeId, int siteId)
{
return await GetJsonAsync<Theme>($"{ApiUrl}/{themeId}?siteid={siteId}");
}
public List<ThemeControl> GetThemeControls(List<Theme> themes)
{
@ -38,6 +42,11 @@ namespace Oqtane.Services
.SelectMany(item => item.Containers).ToList();
}
public async Task UpdateThemeAsync(Theme theme)
{
await PutJsonAsync($"{ApiUrl}/{theme.ThemeId}", theme);
}
public async Task DeleteThemeAsync(string themeName)
{
await DeleteAsync($"{ApiUrl}/{themeName}");