Edit languages to set default.

This commit is contained in:
Ricardo Pacheco
2023-12-07 18:12:49 -06:00
parent 1d230bd4aa
commit 422bf7b689
9 changed files with 328 additions and 9 deletions

View File

@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Oqtane.Documentation;
@ -10,7 +9,7 @@ namespace Oqtane.Services
{
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class LanguageService : ServiceBase, ILanguageService
{
{
public LanguageService(HttpClient http, SiteState siteState) : base(http, siteState) { }
private string Apiurl => CreateApiUrl("Language");
@ -35,6 +34,11 @@ namespace Oqtane.Services
return await PostJsonAsync<Language>(Apiurl, language);
}
public async Task EditLanguageAsync(Language language)
{
await PutJsonAsync<Language>(Apiurl, language);
}
public async Task DeleteLanguageAsync(int languageId)
{
await DeleteAsync($"{Apiurl}/{languageId}");