Skip to content

Commit f6c725a

Browse files
committed
TD-5220 Implements CancelImport method to clear down uploaded file and temp data
1 parent 6e17eca commit f6c725a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

DigitalLearningSolutions.Web/Controllers/FrameworksController/ImportCompetencies.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,15 @@ public IActionResult AddQuestionsToWhichCompetencies(int AddAssessmentQuestionsO
217217
setBulkUploadData(data);
218218
return RedirectToAction("Summary", "Frameworks", new { frameworkId = data.FrameworkId, tabname = data.TabName });
219219
}
220+
[Route("CancelImport")]
221+
public IActionResult CancelImport()
222+
{
223+
var data = GetBulkUploadData();
224+
var frameworkId = data.FrameworkId;
225+
FileHelper.DeleteFile(webHostEnvironment, data.CompetenciesFileName);
226+
TempData.Clear();
227+
return RedirectToAction("ViewFramework", new { frameworkId, tabname = "Structure" });
228+
}
220229
private void setupBulkUploadData(int frameworkId, int adminUserID, string competenciessFileName, string tabName, bool isNotBlank)
221230
{
222231
TempData.Clear();

0 commit comments

Comments
 (0)