* First stab at a massive remake of file system based endpoints * Do not prefix system paths with directory separator char * Ensure correct and consistent response types * Fix partial view snippets endpoints * Clean up IO (path) operations * Update OpenAPI JSON to match new endpoints * Return 201 when renaming file system resources * Add "IsFolder" to file system item endpoints * Replace "parentPath" with a "parent" object for file system creation endpoints * Update OpenAPI JSON * Rewrite snippets * Regenerate OpenAPI JSON after forward merge * Remove stylesheet overview endpoint * Regenerate OpenAPI JSON after forward merge * add server-file-system module to importmap * Expose generated resource identifier in 201 responses --------- Co-authored-by: Mads Rasmussen <madsr@hey.com>
36 lines
1.6 KiB
C#
36 lines
1.6 KiB
C#
using Umbraco.Cms.Core.Models.FileSystem;
|
|
using Umbraco.Cms.Core.Persistence.Repositories;
|
|
using Umbraco.Cms.Core.Scoping;
|
|
using Umbraco.Cms.Core.Services.OperationStatus;
|
|
|
|
namespace Umbraco.Cms.Core.Services.FileSystem;
|
|
|
|
internal class StylesheetFolderService : FolderServiceOperationBase<IStylesheetRepository, StylesheetFolderModel, StylesheetFolderOperationStatus>, IStylesheetFolderService
|
|
{
|
|
public StylesheetFolderService(IStylesheetRepository repository, ICoreScopeProvider scopeProvider)
|
|
: base(repository, scopeProvider)
|
|
{
|
|
}
|
|
|
|
protected override StylesheetFolderOperationStatus Success => StylesheetFolderOperationStatus.Success;
|
|
|
|
protected override StylesheetFolderOperationStatus NotFound => StylesheetFolderOperationStatus.NotFound;
|
|
|
|
protected override StylesheetFolderOperationStatus NotEmpty => StylesheetFolderOperationStatus.NotEmpty;
|
|
|
|
protected override StylesheetFolderOperationStatus AlreadyExists => StylesheetFolderOperationStatus.AlreadyExists;
|
|
|
|
protected override StylesheetFolderOperationStatus ParentNotFound => StylesheetFolderOperationStatus.ParentNotFound;
|
|
|
|
protected override StylesheetFolderOperationStatus InvalidName => StylesheetFolderOperationStatus.InvalidName;
|
|
|
|
|
|
public async Task<StylesheetFolderModel?> GetAsync(string path)
|
|
=> await HandleGetAsync(path);
|
|
|
|
public async Task<Attempt<StylesheetFolderModel?, StylesheetFolderOperationStatus>> CreateAsync(StylesheetFolderCreateModel createModel)
|
|
=> await HandleCreateAsync(createModel.Name, createModel.ParentPath);
|
|
|
|
public async Task<StylesheetFolderOperationStatus> DeleteAsync(string path) => await HandleDeleteAsync(path);
|
|
}
|