diff options
author | crupest <crupest@outlook.com> | 2020-07-10 22:50:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-10 22:50:01 +0800 |
commit | 712cd6b079138e116a6de5d121b875094087e8a9 (patch) | |
tree | b9f6dfdd8aa15304514de696622cbf0c64ab22a7 /Timeline/Controllers | |
parent | e4ca28740d3ccdb64b61361a16bd104009682f6c (diff) | |
parent | 8036808ae8b7865d7d17b232c94b6a04ad197bb1 (diff) | |
download | timeline-712cd6b079138e116a6de5d121b875094087e8a9.tar.gz timeline-712cd6b079138e116a6de5d121b875094087e8a9.tar.bz2 timeline-712cd6b079138e116a6de5d121b875094087e8a9.zip |
Merge pull request #115 from crupest/post-deleted
Add timeline post deleted field.
Diffstat (limited to 'Timeline/Controllers')
-rw-r--r-- | Timeline/Controllers/TimelineController.cs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Timeline/Controllers/TimelineController.cs b/Timeline/Controllers/TimelineController.cs index b8cc608b..2330698f 100644 --- a/Timeline/Controllers/TimelineController.cs +++ b/Timeline/Controllers/TimelineController.cs @@ -102,18 +102,14 @@ namespace Timeline.Controllers }
[HttpGet("timelines/{name}/posts")]
- public async Task<ActionResult<List<TimelinePostInfo>>> PostListGet([FromRoute][GeneralTimelineName] string name, [FromQuery] DateTime? modifiedSince)
+ public async Task<ActionResult<List<TimelinePostInfo>>> PostListGet([FromRoute][GeneralTimelineName] string name, [FromQuery] DateTime? modifiedSince, [FromQuery] bool? includeDeleted)
{
if (!this.IsAdministrator() && !await _service.HasReadPermission(name, this.GetOptionalUserId()))
{
return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
}
- List<TimelinePost> posts;
- if (modifiedSince == null)
- posts = await _service.GetPosts(name);
- else
- posts = await _service.GetPosts(name, modifiedSince.Value);
+ List<TimelinePost> posts = await _service.GetPosts(name, modifiedSince, includeDeleted ?? false);
var result = _mapper.Map<List<TimelinePostInfo>>(posts);
return result;
|