Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed additional partial application updates #498

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,9 @@ private async Task ExecuteMvpTypeStep(ApplicationFormModel model)
{
if (model.CurrentApplication != null)
{
Application updateApplication = new(model.CurrentApplication.Id)
{
MvpType = new MvpType(model.MvpTypeId)
};
model.CurrentApplication.MvpType = new MvpType(model.MvpTypeId);
Response<Application> applicationResponse =
await Client.UpdateApplicationAsync(updateApplication);
await Client.UpdateApplicationAsync(model.CurrentApplication);
if (applicationResponse is { StatusCode: HttpStatusCode.OK, Result: not null })
{
model.CurrentApplication = applicationResponse.Result;
Expand Down Expand Up @@ -364,16 +361,13 @@ private async Task ExecuteMvpTypeStep(ApplicationFormModel model)

private async Task ExecuteObjectivesStep(ApplicationFormModel model)
{
if (model.IsNavigation.HasValue && !model.IsNavigation.Value && !string.IsNullOrWhiteSpace(model.Eligibility) && !string.IsNullOrWhiteSpace(model.Objectives))
if (model.IsNavigation.HasValue && !model.IsNavigation.Value && !string.IsNullOrWhiteSpace(model.Eligibility) && !string.IsNullOrWhiteSpace(model.Objectives) && model.CurrentApplication != null)
{
Application updateApplication = new(model.CurrentApplication!.Id)
{
Eligibility = model.Eligibility,
Objectives = model.Objectives,
Mentor = model.Mentors
};
model.CurrentApplication.Eligibility = model.Eligibility;
model.CurrentApplication.Objectives = model.Objectives;
model.CurrentApplication.Mentor = model.Mentors;
Response<Application> applicationResponse =
await Client.UpdateApplicationAsync(updateApplication);
await Client.UpdateApplicationAsync(model.CurrentApplication);
if (applicationResponse is { StatusCode: HttpStatusCode.OK, Result: not null })
{
model.CurrentApplication = applicationResponse.Result;
Expand Down Expand Up @@ -568,13 +562,10 @@ private async Task ExecuteConfirmationStep(ApplicationFormModel model)

private async Task ExecuteSubmittedStep(ApplicationFormModel model)
{
if (model.IsNavigation.HasValue && !model.IsNavigation.Value)
if (model.IsNavigation.HasValue && !model.IsNavigation.Value && model.CurrentApplication != null)
{
Application updateApplication = new(model.CurrentApplication!.Id)
{
Status = ApplicationStatus.Open
};
Response<Application> applicationResponse = await Client.UpdateApplicationAsync(updateApplication);
model.CurrentApplication.Status = ApplicationStatus.Open;
Response<Application> applicationResponse = await Client.UpdateApplicationAsync(model.CurrentApplication);
if (applicationResponse is { StatusCode: HttpStatusCode.OK, Result: not null })
{
model.CurrentApplication = applicationResponse.Result;
Expand Down
Loading