Skip to content

Commit b256b05

Browse files
TD-1944 Changed static value of callType to enum
1 parent ad6086f commit b256b05

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace DigitalLearningSolutions.Data.Enums
2+
{
3+
public enum ViewDelegateNavigationType
4+
{
5+
PromoteToAdmin
6+
}
7+
}

DigitalLearningSolutions.Web/Controllers/TrackingSystem/Delegates/PromoteToAdminController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public IActionResult Index(AdminRolesFormData formData, int delegateId)
173173
return new StatusCodeResult(500);
174174
}
175175
TempData["IsDelegatePromoted"] = true;
176-
return RedirectToAction("Index", "ViewDelegate", new { delegateId = delegateId, callType = 1 });
176+
return RedirectToAction("Index", "ViewDelegate", new { delegateId = delegateId, callType = ViewDelegateNavigationType.PromoteToAdmin });
177177
}
178178
}
179179
}

DigitalLearningSolutions.Web/Controllers/TrackingSystem/Delegates/ViewDelegateController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ IEmailVerificationDataService emailVerificationDataService
5757
this.emailVerificationDataService = emailVerificationDataService;
5858
}
5959

60-
public IActionResult Index(int delegateId, int? callType)
60+
public IActionResult Index(int delegateId, string? callType)
6161
{
6262
var centreId = User.GetCentreIdKnownNotNull();
6363

@@ -68,7 +68,7 @@ public IActionResult Index(int delegateId, int? callType)
6868
return NotFound();
6969
}
7070

71-
if (callType == null && TempData["IsDelegatePromoted"] != null)
71+
if (string.IsNullOrEmpty(callType) && TempData["IsDelegatePromoted"] != null)
7272
{
7373
TempData.Remove("IsDelegatePromoted");
7474
}

0 commit comments

Comments
 (0)