Exemple #1
0
        public async Task <IActionResult> DeleteFolder(Guid id)
        {
            try
            {
                var folderId = await _service.DeleteFolder(id);

                var result = await _service.GetList(folderId);

                result.Status = new StatusMessage
                {
                    Type = StatusMessage.Success,
                    Body = $"The folder was successfully deleted"
                };

                return(Ok(result));
            }
            catch (ValidationException e)
            {
                var result = new MediaListModel();
                result.Status = new StatusMessage
                {
                    Type = StatusMessage.Error,
                    Body = e.Message
                };
                return(BadRequest(result));
            }
        }