Merge pull request #783 from mikecasas/master

Refactor to eliminate repetitive code.
This commit is contained in:
Shaun Walker 2020-10-07 09:24:43 -04:00 committed by GitHub
commit fde43b6c39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,13 +173,15 @@ namespace Oqtane.Services
// add entityid parameter to url for custom authorization policy
public string CreateAuthorizationPolicyUrl(string url, int entityId)
{
string qs = "entityid=" + entityId.ToString();
if (url.Contains("?"))
{
return url + "&entityid=" + entityId.ToString();
return url + "&" + qs;
}
else
{
return url + "?entityid=" + entityId.ToString();
return url + "?" + qs;
}
}