From a46460a3cc71497bc7d360ab3d7068059bc7a0cc Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 4 Feb 2021 21:26:01 +0800 Subject: ... --- BackEnd/Timeline/Controllers/TimelinePostController.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'BackEnd/Timeline/Controllers/TimelinePostController.cs') 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) { -- cgit v1.2.3