diff --git a/Api.SeaHavenIndustries/Controllers/WorkOrderController.cs b/Api.SeaHavenIndustries/Controllers/WorkOrderController.cs index 8ad8fae..929d29a 100644 --- a/Api.SeaHavenIndustries/Controllers/WorkOrderController.cs +++ b/Api.SeaHavenIndustries/Controllers/WorkOrderController.cs @@ -411,7 +411,11 @@ namespace Api.SeaHavenIndustries.Controllers dueDate = w.DueDate, assignedTo = w.AssignToUser != null ? w.AssignToUser.FirstName + " " + w.AssignToUser.LastName : "", employeeName = w.AssignToUser != null ? w.AssignToUser.FirstName + " " + w.AssignToUser.LastName : "", - lastUpdated = w.LastModificationTime + lastUpdated = new[] { + w.LastModificationTime, + w.Comments.Max(c => (DateTime?)c.CreatedDate), + _db.WorkOrderAuditLogs.Where(a => a.WorkOrderId == w.Id).Max(a => (DateTime?)a.CreatedAt) + }.Where(d => d.HasValue).Max() }) .ToList();