Ejemplo n.º 1
0
        public IActionResult ChangeFolderName(ChangeFolderData changeFolderData)
        {
            if (userGet.HaveUser(HttpContext))
            {
                Success success = folderRepository.ChangeFolderData(
                    userGet.GetUser(HttpContext),
                    changeFolderData.originalFolder,
                    changeFolderData.Name,
                    changeFolderData.Access);
                switch (success)
                {
                case Success.Successfull:
                    return(Ok());

                case Success.FailedByNotExist:
                    return(BadRequest("Folder doesn't exist!"));

                case Success.FailedByUsedName:
                    return(BadRequest("Foldername already used!"));
                }
            }
            return(Unauthorized());
        }