Skip to content

Commit

Permalink
Rename parameter for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Johnson committed Oct 5, 2021
1 parent 4eb7579 commit 106f6dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function entityResource($q, $http, umbRequestHelper) {
'Failed to retrieve url for id:' + id);
},

getUrlsByUdis: function(ids, culture) {
getUrlsByUdis: function(udis, culture) {
var query = "culture=" + (culture || "");

return umbRequestHelper.resourcePromise(
Expand All @@ -137,9 +137,9 @@ function entityResource($q, $http, umbRequestHelper) {
"GetUrlsByUdis",
query),
{
ids: ids
udis: udis
}),
'Failed to retrieve url map for ids ' + ids);
'Failed to retrieve url map for udis ' + udis);
},

getUrlByUdi: function (udi, culture) {
Expand Down
13 changes: 4 additions & 9 deletions src/Umbraco.Web/Editors/EntityController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public HttpResponseMessage GetUrl(Udi udi, string culture = "*")
/// <summary>
/// Get entity URLs by UDIs
/// </summary>
/// <param name="ids">
/// <param name="udis">
/// A list of UDIs to lookup items by
/// </param>
/// <param name="culture">The culture to fetch the URL for</param>
Expand All @@ -248,14 +248,9 @@ public HttpResponseMessage GetUrl(Udi udi, string culture = "*")
/// </remarks>
[HttpGet]
[HttpPost]
public IDictionary<Udi, string> GetUrlsByUdis([FromJsonPath] Udi[] ids, string culture = null)
public IDictionary<Udi, string> GetUrlsByUdis([FromJsonPath] Udi[] udis, string culture = null)
{
if (ids == null)
{
throw new HttpResponseException(HttpStatusCode.NotFound);
}

if (ids.Length == 0)
if (udis == null || udis.Length == 0)
{
return new Dictionary<Udi, string>();
}
Expand All @@ -277,7 +272,7 @@ string MediaOrDocumentUrl(Udi udi)
};
}

return ids
return udis
.Select(udi => new {
Udi = udi,
Url = MediaOrDocumentUrl(udi)
Expand Down

0 comments on commit 106f6dc

Please sign in to comment.