Example #1
0
        public OperationResultWithData <FolderDto> CreateSubFolder(string folderScoId, [FromBody] FolderDto dto)
        {
            if (dto == null)
            {
                throw new ArgumentNullException(nameof(dto));
            }

            try
            {
                if (!LmsCompany.GetSetting <bool>(LmsCompanySettingNames.EnableMyContent))
                {
                    return(OperationResultWithData <FolderDto> .Error("Operation is not enabled."));
                }

                // TRICK:
                dto.FolderId = folderScoId;

                var ac     = this.GetUserProvider();
                var helper = new ContentEditControllerHelper(Logger, ac);
                return(helper.CreateFolder(dto));
            }
            catch (Exception ex)
            {
                string errorMessage = GetOutputErrorMessage("ContentApi-CreateSubFolder", ex);
                return(OperationResultWithData <FolderDto> .Error(errorMessage));
            }
        }
Example #2
0
        public OperationResultWithData <FolderDto> CreateSubFolder(string folderScoId, [FromBody] FolderDto dto)
        {
            try
            {
                // TRICK:
                dto.FolderId = folderScoId;

                var ac     = this.GetUserProvider();
                var helper = new ContentEditControllerHelper(Logger, ac);
                return(helper.CreateFolder(dto));
            }
            catch (Exception ex)
            {
                string errorMessage = GetOutputErrorMessage("ContentApi-CreateSubFolder", ex);
                return(OperationResultWithData <FolderDto> .Error(errorMessage));
            }
        }