From 63ffd17ff96906cd1d00d7496549b1bdc8e90da2 Mon Sep 17 00:00:00 2001 From: Roger Howell Date: Thu, 8 Feb 2024 21:13:29 +0000 Subject: [PATCH] Simplify code which creates a new assessment --- .../Database/Entities/AssessmentType.cs | 2 +- .../Database/Entities/Phase.cs | 2 +- .../Pages/Book/Request/StartNew.cshtml.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ServiceAssessmentService/ServiceAssessmentService.Application/Database/Entities/AssessmentType.cs b/src/ServiceAssessmentService/ServiceAssessmentService.Application/Database/Entities/AssessmentType.cs index a5adcd38..d229a262 100644 --- a/src/ServiceAssessmentService/ServiceAssessmentService.Application/Database/Entities/AssessmentType.cs +++ b/src/ServiceAssessmentService/ServiceAssessmentService.Application/Database/Entities/AssessmentType.cs @@ -24,7 +24,7 @@ internal class AssessmentType public static Database.Entities.AssessmentType? FromDomain(Domain.Model.AssessmentType? domainModel) { - if(domainModel == null) + if (domainModel == null) { return null; } diff --git a/src/ServiceAssessmentService/ServiceAssessmentService.Application/Database/Entities/Phase.cs b/src/ServiceAssessmentService/ServiceAssessmentService.Application/Database/Entities/Phase.cs index 24787077..45b9bb2e 100644 --- a/src/ServiceAssessmentService/ServiceAssessmentService.Application/Database/Entities/Phase.cs +++ b/src/ServiceAssessmentService/ServiceAssessmentService.Application/Database/Entities/Phase.cs @@ -23,7 +23,7 @@ internal class Phase public static Database.Entities.Phase? FromDomain(Domain.Model.Phase? domainModel) { - if(domainModel == null) + if (domainModel == null) { return null; } diff --git a/src/ServiceAssessmentService/ServiceAssessmentService.WebApp/Pages/Book/Request/StartNew.cshtml.cs b/src/ServiceAssessmentService/ServiceAssessmentService.WebApp/Pages/Book/Request/StartNew.cshtml.cs index f65206a0..32503ecb 100644 --- a/src/ServiceAssessmentService/ServiceAssessmentService.WebApp/Pages/Book/Request/StartNew.cshtml.cs +++ b/src/ServiceAssessmentService/ServiceAssessmentService.WebApp/Pages/Book/Request/StartNew.cshtml.cs @@ -19,14 +19,14 @@ public StartNewPageModel(AssessmentRequestRepository assessmentRequestRepository public async Task OnPost() { _logger.LogInformation("Attempting to create a new assessment request"); - + var assessmentRequest = await _assessmentRequestRepository.CreateAsync(); - if(assessmentRequest is null) + if (assessmentRequest is null) { _logger.LogError("Failed to create a new assessment request"); return RedirectToPage("/Error"); } - + _logger.LogInformation("Created new assessment request with ID {Id}", assessmentRequest.Id); return RedirectToPage("/Book/Request/Question/PhaseConcluding", new { assessmentRequest.Id });