Adds getAllPropertyEditors to datatype resource
This commit is contained in:
@@ -135,6 +135,16 @@ function dataTypeResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
'Failed to retrieve data');
|
||||
},
|
||||
|
||||
getAllPropertyEditors: function () {
|
||||
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get(
|
||||
umbRequestHelper.getApiUrl(
|
||||
"dataTypeApiBaseUrl",
|
||||
"GetAllPropertyEditors")),
|
||||
'Failed to retrieve data');
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name umbraco.resources.contentResource#getScaffold
|
||||
|
||||
@@ -114,6 +114,23 @@ namespace Umbraco.Web.Editors
|
||||
.Select(Mapper.Map<PropertyEditorBasic>);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content json for all property editors
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// Permission is granted to this method if the user has access to any of these trees: DataTypes, Content or Media
|
||||
/// </remarks>
|
||||
[UmbracoTreeAuthorize(Constants.Trees.DataTypes, Constants.Trees.Content, Constants.Trees.Media)]
|
||||
public IEnumerable<PropertyEditorBasic> GetAllPropertyEditors()
|
||||
{
|
||||
return PropertyEditorResolver.Current.PropertyEditors
|
||||
.OrderBy(x => x.Name)
|
||||
.Select(Mapper.Map<PropertyEditorBasic>);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a data type wth a given ID
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user