Use string Interpolation for constructing Urls (#324)
This commit is contained in:
@ -28,13 +28,13 @@ namespace Oqtane.Services
|
||||
|
||||
public async Task<List<Package>> GetPackagesAsync(string tag)
|
||||
{
|
||||
List<Package> packages = await _http.GetJsonAsync<List<Package>>(Apiurl + "?tag=" + tag);
|
||||
List<Package> packages = await _http.GetJsonAsync<List<Package>>($"{Apiurl}?tag={tag}");
|
||||
return packages.OrderByDescending(item => item.Downloads).ToList();
|
||||
}
|
||||
|
||||
public async Task DownloadPackageAsync(string packageId, string version, string folder)
|
||||
{
|
||||
await _http.PostJsonAsync(Apiurl + "?packageid=" + packageId + "&version=" + version + "&folder=" + folder, null);
|
||||
await _http.PostJsonAsync($"{Apiurl}?packageid={packageId}&version={version}&folder={folder}", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user