diff options
author | crupest <crupest@outlook.com> | 2021-02-04 21:26:01 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-04 21:26:01 +0800 |
commit | c6a4b88794cb87c25757542ad0642e9df56ddf0f (patch) | |
tree | 6cf4581e12f10f4d6b6d17ac95f1c6eb1f819eec /BackEnd/Timeline/Controllers | |
parent | 1af0c82144a0f28f86922ecda04b159a553c699e (diff) | |
download | timeline-c6a4b88794cb87c25757542ad0642e9df56ddf0f.tar.gz timeline-c6a4b88794cb87c25757542ad0642e9df56ddf0f.tar.bz2 timeline-c6a4b88794cb87c25757542ad0642e9df56ddf0f.zip |
...
Diffstat (limited to 'BackEnd/Timeline/Controllers')
-rw-r--r-- | BackEnd/Timeline/Controllers/TimelinePostController.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/BackEnd/Timeline/Controllers/TimelinePostController.cs b/BackEnd/Timeline/Controllers/TimelinePostController.cs index 6b7ba411..3f31decf 100644 --- a/BackEnd/Timeline/Controllers/TimelinePostController.cs +++ b/BackEnd/Timeline/Controllers/TimelinePostController.cs @@ -135,6 +135,8 @@ namespace Timeline.Controllers TimelinePostEntity post;
+ TimelinePostCommonProperties properties = new TimelinePostCommonProperties { Color = body.Color, Time = body.Time };
+
if (content.Type == TimelinePostContentTypes.Text)
{
var text = content.Text;
@@ -142,7 +144,7 @@ namespace Timeline.Controllers {
return BadRequest(ErrorResponse.Common.CustomMessage_InvalidModel(Resources.Messages.TimelineController_TextContentTextRequired));
}
- post = await _postService.CreateTextPost(timelineId, userId, text, new TimelinePostCommonProperties { Time = body.Time });
+ post = await _postService.CreateTextPost(timelineId, userId, text, properties);
}
else if (content.Type == TimelinePostContentTypes.Image)
{
@@ -163,7 +165,7 @@ namespace Timeline.Controllers try
{
- post = await _postService.CreateImagePost(timelineId, userId, data, new TimelinePostCommonProperties { Time = body.Time });
+ post = await _postService.CreateImagePost(timelineId, userId, data, properties);
}
catch (ImageException)
{
|