Use string Interpolation for constructing Urls (#324)
This commit is contained in:
@ -26,12 +26,12 @@ namespace Oqtane.Services
|
||||
|
||||
public async Task<PageModule> GetPageModuleAsync(int pageModuleId)
|
||||
{
|
||||
return await _http.GetJsonAsync<PageModule>(Apiurl + "/" + pageModuleId.ToString());
|
||||
return await _http.GetJsonAsync<PageModule>($"{Apiurl}/{pageModuleId.ToString()}");
|
||||
}
|
||||
|
||||
public async Task<PageModule> GetPageModuleAsync(int pageId, int moduleId)
|
||||
{
|
||||
return await _http.GetJsonAsync<PageModule>(Apiurl + "/" + pageId.ToString() + "/" + moduleId.ToString());
|
||||
return await _http.GetJsonAsync<PageModule>($"{Apiurl}/{pageId.ToString()}/{moduleId.ToString()}");
|
||||
}
|
||||
|
||||
public async Task<PageModule> AddPageModuleAsync(PageModule pageModule)
|
||||
@ -41,17 +41,17 @@ namespace Oqtane.Services
|
||||
|
||||
public async Task<PageModule> UpdatePageModuleAsync(PageModule pageModule)
|
||||
{
|
||||
return await _http.PutJsonAsync<PageModule>(Apiurl + "/" + pageModule.PageModuleId.ToString(), pageModule);
|
||||
return await _http.PutJsonAsync<PageModule>($"{Apiurl}/{pageModule.PageModuleId.ToString()}", pageModule);
|
||||
}
|
||||
|
||||
public async Task UpdatePageModuleOrderAsync(int pageId, string pane)
|
||||
{
|
||||
await _http.PutJsonAsync(Apiurl + "/?pageid=" + pageId.ToString() + "&pane=" + pane, null);
|
||||
await _http.PutJsonAsync($"{Apiurl}/?pageid={pageId.ToString()}&pane={pane}", null);
|
||||
}
|
||||
|
||||
public async Task DeletePageModuleAsync(int pageModuleId)
|
||||
{
|
||||
await _http.DeleteAsync(Apiurl + "/" + pageModuleId.ToString());
|
||||
await _http.DeleteAsync($"{Apiurl}/{pageModuleId.ToString()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user