aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/TimelinePostController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-04 21:26:01 +0800
committercrupest <crupest@outlook.com>2021-02-04 21:26:01 +0800
commita46460a3cc71497bc7d360ab3d7068059bc7a0cc (patch)
treed1d361e9e5204c06b4356db6d20e7b0adcc39021 /BackEnd/Timeline/Controllers/TimelinePostController.cs
parentad1e58e80ca5e3eb1e72b93affa82082a3ee861b (diff)
downloadtimeline-a46460a3cc71497bc7d360ab3d7068059bc7a0cc.tar.gz
timeline-a46460a3cc71497bc7d360ab3d7068059bc7a0cc.tar.bz2
timeline-a46460a3cc71497bc7d360ab3d7068059bc7a0cc.zip
...
Diffstat (limited to 'BackEnd/Timeline/Controllers/TimelinePostController.cs')
-rw-r--r--BackEnd/Timeline/Controllers/TimelinePostController.cs6
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)
{