Align template picking more towards the other pickers (#11363)
* Align template picking more towards the other pickers * style/cleanup - remove unused args, updated openItemPicker function name to openTemplatePicker since that's what we're opening Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
This commit is contained in:
@@ -997,6 +997,15 @@ namespace Umbraco.Web.Editors
|
||||
|
||||
case UmbracoEntityTypes.Macro:
|
||||
|
||||
case UmbracoEntityTypes.Template:
|
||||
var template = Services.FileService.GetTemplate(key);
|
||||
if (template is null)
|
||||
{
|
||||
throw new HttpResponseException(HttpStatusCode.NotFound);
|
||||
}
|
||||
|
||||
return Mapper.Map<ITemplate, EntityBasic>(template);
|
||||
|
||||
default:
|
||||
throw new NotSupportedException("The " + typeof(EntityController) + " does not currently support data for the type " + entityType);
|
||||
}
|
||||
@@ -1029,6 +1038,15 @@ namespace Umbraco.Web.Editors
|
||||
|
||||
case UmbracoEntityTypes.Macro:
|
||||
|
||||
case UmbracoEntityTypes.Template:
|
||||
var template = Services.FileService.GetTemplate(id);
|
||||
if (template is null)
|
||||
{
|
||||
throw new HttpResponseException(HttpStatusCode.NotFound);
|
||||
}
|
||||
|
||||
return Mapper.Map<ITemplate, EntityBasic>(template);
|
||||
|
||||
default:
|
||||
throw new NotSupportedException("The " + typeof(EntityController) + " does not currently support data for the type " + entityType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user