Esempio n. 1
0
        public async Task <IActionResult> DeleteBetaVersions(string projectName)
        {
            var previewVersionsToDelete = await _projectVersionsService.GetAllPreviewVersionsExceptFirstAndLastAsync(projectName);

            var model = new DeleteBetaVersionsViewModel
            {
                ProjectName      = projectName,
                VersionsToDelete = previewVersionsToDelete
            };

            return(View(model));
        }
Esempio n. 2
0
        public async Task <IActionResult> ConfirmDeleteBetaVersions(string projectName)
        {
            var projectId = await _projectsService.GetIdForProjectByNameAsync(projectName);

            var previewVersionsToDelete = await _projectVersionsService.GetAllPreviewVersionsExceptFirstAndLastAsync(projectName);

            foreach (var previewVersionToDelete in previewVersionsToDelete)
            {
                await _projectFilesService.DeleteProjectVersionPackageAsync(projectId, previewVersionToDelete);
            }
            ViewBag.SuccessMessage = $"Deleted obsolete beta versions for {projectName}.";
            var model = new DeleteBetaVersionsViewModel
            {
                ProjectName      = projectName,
                VersionsToDelete = new List <string>()
            };

            return(View(nameof(DeleteBetaVersions), model));
        }