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 | a46460a3cc71497bc7d360ab3d7068059bc7a0cc (patch) | |
tree | d1d361e9e5204c06b4356db6d20e7b0adcc39021 /BackEnd/Timeline/Controllers/TimelinePostController.cs | |
parent | ad1e58e80ca5e3eb1e72b93affa82082a3ee861b (diff) | |
download | timeline-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.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)
{
|