Skip to content

Commit 5cbc500

Browse files
committed
Fixing so the code is able to restore removed cases and set the date correctly even if the original is null.
1 parent 19de0df commit 5cbc500

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationCaseService/BackendConfigurationCaseService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,18 @@ public async Task<OperationResult> Update(ReplyRequest model)
6464
{
6565
var newDoneAt = new DateTime(model.DoneAt.Year, model.DoneAt.Month, model.DoneAt.Day, foundCase.DoneAt.Value.Hour, foundCase.DoneAt.Value.Minute, foundCase.DoneAt.Value.Second);
6666
foundCase.DoneAtUserModifiable = newDoneAt;
67+
} else
68+
{
69+
var newDoneAt = new DateTime(model.DoneAt.Year, model.DoneAt.Month, model.DoneAt.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
70+
foundCase.DoneAtUserModifiable = newDoneAt;
6771
}
6872

6973
foundCase.Status = 100;
7074
if (model.SiteId != 0)
7175
{
7276
foundCase.SiteId = model.SiteId;
7377
}
78+
foundCase.WorkflowState = Constants.WorkflowStates.Created;
7479
await foundCase.Update(sdkDbContext);
7580
var planningCase = await dbContext.PlanningCases.SingleAsync(x => x.MicrotingSdkCaseId == model.Id);
7681
var planningCaseSite = await dbContext.PlanningCaseSites.FirstOrDefaultAsync(x => x.MicrotingSdkCaseId == model.Id && x.PlanningCaseId == planningCase.Id && x.Status == 100);

0 commit comments

Comments
 (0)