From a362066a9a8e64b8c8d58ec5952cb28caa217b35 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 10 Jul 2020 20:18:08 +0800 Subject: Add http api and integrated tests. --- Timeline/Controllers/TimelineController.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'Timeline/Controllers/TimelineController.cs') 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>> PostListGet([FromRoute][GeneralTimelineName] string name, [FromQuery] DateTime? modifiedSince) + public async Task>> 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 posts; - if (modifiedSince == null) - posts = await _service.GetPosts(name); - else - posts = await _service.GetPosts(name, modifiedSince.Value); + List posts = await _service.GetPosts(name, modifiedSince, includeDeleted ?? false); var result = _mapper.Map>(posts); return result; -- cgit v1.2.3