aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Web
diff options
context:
space:
mode:
Diffstat (limited to 'src/DevHive.Web')
-rw-r--r--src/DevHive.Web/Configurations/Mapping/CommentMappings.cs14
-rw-r--r--src/DevHive.Web/Models/Post/Comment/CreateCommentWebModel.cs13
-rw-r--r--src/DevHive.Web/Models/Post/Comment/ReadCommentWebModel.cs2
-rw-r--r--src/DevHive.Web/Models/Post/Comment/UpdateCommentWebModel.cs3
4 files changed, 26 insertions, 6 deletions
diff --git a/src/DevHive.Web/Configurations/Mapping/CommentMappings.cs b/src/DevHive.Web/Configurations/Mapping/CommentMappings.cs
index 5998e7a..296704e 100644
--- a/src/DevHive.Web/Configurations/Mapping/CommentMappings.cs
+++ b/src/DevHive.Web/Configurations/Mapping/CommentMappings.cs
@@ -8,10 +8,16 @@ namespace DevHive.Web.Configurations.Mapping
{
public CommentMappings()
{
- CreateMap<CommentWebModel, CommentServiceModel>();
- CreateMap<CommentWebModel, UpdateCommentServiceModel>();
- CreateMap<CommentServiceModel, CommentWebModel>();
- CreateMap<CommentWebModel, CommentServiceModel>();
+ CreateMap<CreateCommentWebModel, CreateCommentServiceModel>();
+ CreateMap<UpdateCommentWebModel, UpdateCommentServiceModel>();
+
+ CreateMap<ReadCommentServiceModel, ReadCommentWebModel>()
+ .ForMember(dest => dest.IssuerFirstName, src => src.Ignore())
+ .ForMember(dest => dest.IssuerLastName, src => src.Ignore())
+ .ForMember(dest => dest.IssuerUsername, src => src.Ignore());
}
}
}
+
+
+
diff --git a/src/DevHive.Web/Models/Post/Comment/CreateCommentWebModel.cs b/src/DevHive.Web/Models/Post/Comment/CreateCommentWebModel.cs
index 3680727..85c67bf 100644
--- a/src/DevHive.Web/Models/Post/Comment/CreateCommentWebModel.cs
+++ b/src/DevHive.Web/Models/Post/Comment/CreateCommentWebModel.cs
@@ -1,6 +1,17 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.Diagnostics.CodeAnalysis;
+
namespace DevHive.Web.Models.Post.Comment
{
- public class CreateCommentWebModel : BaseCommentWebModel
+ public class CreateCommentWebModel
{
+ [NotNull]
+ [Required]
+ public Guid PostId { get; set; }
+
+ [NotNull]
+ [Required]
+ public string Message { get; set; }
}
}
diff --git a/src/DevHive.Web/Models/Post/Comment/ReadCommentWebModel.cs b/src/DevHive.Web/Models/Post/Comment/ReadCommentWebModel.cs
index 2c4a367..5320c3c 100644
--- a/src/DevHive.Web/Models/Post/Comment/ReadCommentWebModel.cs
+++ b/src/DevHive.Web/Models/Post/Comment/ReadCommentWebModel.cs
@@ -4,6 +4,8 @@ namespace DevHive.Web.Models.Post.Comment
{
public class ReadCommentWebModel
{
+ public Guid CommentId { get; set; }
+
public Guid PostId { get; set; }
public string IssuerFirstName { get; set; }
diff --git a/src/DevHive.Web/Models/Post/Comment/UpdateCommentWebModel.cs b/src/DevHive.Web/Models/Post/Comment/UpdateCommentWebModel.cs
index 49f4540..8e78a48 100644
--- a/src/DevHive.Web/Models/Post/Comment/UpdateCommentWebModel.cs
+++ b/src/DevHive.Web/Models/Post/Comment/UpdateCommentWebModel.cs
@@ -1,6 +1,7 @@
namespace DevHive.Web.Models.Post.Comment
{
- public class UpdateCommentWebModel : BaseCommentWebModel
+ public class UpdateCommentWebModel
{
+ public string NewMessage { get; set; }
}
}