diff --git a/Marco.Pms.Services/Controllers/ImageController.cs b/Marco.Pms.Services/Controllers/ImageController.cs index eaab3c6..efbd134 100644 --- a/Marco.Pms.Services/Controllers/ImageController.cs +++ b/Marco.Pms.Services/Controllers/ImageController.cs @@ -182,6 +182,11 @@ namespace Marco.Pms.Services.Controllers var source = task != null ? "Report" : comment != null ? "Comment" : ""; var uploadedBy = task?.ReportedBy ?? comment?.Employee; + if (comment != null) + { + task = tasks.FirstOrDefault(t => t.Id == comment.TaskAllocationId); + } + var workItem = workItems.FirstOrDefault(w => w.Id == task?.WorkItemId); var workArea = workAreas.FirstOrDefault(wa => wa.Id == workItem?.WorkAreaId); var floor = floors.FirstOrDefault(f => f.Id == workArea?.FloorId);