Some more refactoring

This commit is contained in:
Elitsa Marinovska
2021-01-12 16:01:09 +01:00
parent b0f4f9f440
commit 5feb273c3a
3 changed files with 5 additions and 5 deletions

View File

@@ -621,7 +621,7 @@ namespace Umbraco.Web.BackOffice.Controllers
/// </summary>
[FileUploadCleanupFilter]
[ContentSaveValidation]
public async Task<ContentItemDisplay> PostSaveBlueprint([ModelBinder(typeof(BlueprintItemBinder))] ContentItemSave contentItem)
public async Task<ActionResult<ContentItemDisplay>> PostSaveBlueprint([ModelBinder(typeof(BlueprintItemBinder))] ContentItemSave contentItem)
{
var contentItemDisplay = await PostSaveInternal(
contentItem,
@@ -641,7 +641,7 @@ namespace Umbraco.Web.BackOffice.Controllers
return display;
});
return contentItemDisplay.Value;
return contentItemDisplay;
}
/// <summary>

View File

@@ -557,7 +557,7 @@ namespace Umbraco.Web.BackOffice.Controllers
if (invalidCompositionException != null)
{
AddCompositionValidationErrors<TContentTypeSave, TPropertyType>(contentTypeSave, invalidCompositionException.PropertyTypeAliases);
throw CreateModelStateValidationException<TContentTypeSave, TContentTypeDisplay>(ctId, contentTypeSave, ct);
return CreateModelStateValidationException<TContentTypeSave, TContentTypeDisplay>(ctId, contentTypeSave, ct);
}
return null;
}

View File

@@ -663,7 +663,7 @@ namespace Umbraco.Web.BackOffice.Controllers
public async Task<ActionResult<MediaItemDisplay>> PostAddFolder(PostedFolder folder)
{
var parentId = GetParentIdAsIntAsync(folder.ParentId, validatePermissions:true).Result.Value;
var parentId = (await GetParentIdAsIntAsync(folder.ParentId, validatePermissions:true)).Value;
if (!parentId.HasValue)
{
return NotFound("The passed id doesn't exist");
@@ -695,7 +695,7 @@ namespace Umbraco.Web.BackOffice.Controllers
}
//get the string json from the request
var parentId = GetParentIdAsIntAsync(currentFolder, validatePermissions: true).Result.Value;
var parentId = (await GetParentIdAsIntAsync(currentFolder, validatePermissions: true)).Value;
if (!parentId.HasValue)
{
return NotFound("The passed id doesn't exist");