#145 add comments for devices

This commit is contained in:
Gary Sharp
2025-07-17 11:40:50 +10:00
parent 2184c9e22e
commit f8fd1a58a3
35 changed files with 2047 additions and 614 deletions
@@ -46,5 +46,19 @@ namespace Disco.Web.Areas.API.Models.Shared
};
}
public static CommentModel FromEntity(DeviceComment comment)
{
return new CommentModel
{
Id = comment.Id,
TargetType = AttachmentTypes.Device,
TargetId = comment.DeviceSerialNumber,
AuthorId = comment.TechUserId,
Author = comment.TechUser.ToString(),
Timestamp = comment.Timestamp,
Comments = comment.Comments,
HtmlComments = comment.Comments.ToHtmlComment().ToString()
};
}
}
}