aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/TimelineController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-07-10 20:18:08 +0800
committercrupest <crupest@outlook.com>2020-07-10 20:18:08 +0800
commit94f64bd98a267360a9e941b86c56c614605067f2 (patch)
tree1f3229b149497657e37830e7042f4c4f09b61105 /Timeline/Controllers/TimelineController.cs
parentf93ac5c1b21f9bee827c51955bd831ce0d322aaf (diff)
downloadtimeline-94f64bd98a267360a9e941b86c56c614605067f2.tar.gz
timeline-94f64bd98a267360a9e941b86c56c614605067f2.tar.bz2
timeline-94f64bd98a267360a9e941b86c56c614605067f2.zip
Add http api and integrated tests.
Diffstat (limited to 'Timeline/Controllers/TimelineController.cs')
-rw-r--r--Timeline/Controllers/TimelineController.cs8
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;