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 | 15e7467e6089537f0f3e2290f14a99b8a1fc2d76 (patch) | |
tree | a0ba363d1df5d1846f3a46bae4d0ffe7b72e1c89 /Timeline/Controllers | |
parent | 838f9377514b03404afa1d6b6e42e981174178b5 (diff) | |
parent | 3735e7fecd2c9eaf525cedb55912f918aad20779 (diff) | |
download | timeline-15e7467e6089537f0f3e2290f14a99b8a1fc2d76.tar.gz timeline-15e7467e6089537f0f3e2290f14a99b8a1fc2d76.tar.bz2 timeline-15e7467e6089537f0f3e2290f14a99b8a1fc2d76.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;
|