Deduplicate the magic string "/management/api/" (#16016)

This commit is contained in:
Kenn Jacobsen
2024-04-10 14:21:59 +02:00
committed by GitHub
parent 7b6db02426
commit 1c799802c5
5 changed files with 13 additions and 9 deletions

View File

@@ -62,6 +62,11 @@ public static partial class Constants
public const string BackOfficeLoginArea = "UmbracoLogin"; // Used for area routes of non-api controllers for login
}
/// <summary>
/// The "base" path to the Management API
/// </summary>
public const string ManagementApiPath = "/management/api/";
public static class Routing
{
public const string ControllerToken = "controller";

View File

@@ -40,7 +40,7 @@ public class UmbracoRequestPaths
_previewMvcPath = "/" + mvcArea + "/Preview/";
_surfaceMvcPath = "/" + mvcArea + "/Surface/";
_apiMvcPath = "/" + mvcArea + "/Api/";
_managementApiPath = "/" + mvcArea + "/management/api/";
_managementApiPath = "/" + mvcArea + Constants.Web.ManagementApiPath;
_installPath = hostingEnvironment.ToAbsolute(Constants.SystemDirectories.Install);
_umbracoRequestPathsOptions = umbracoRequestPathsOptions;
}