diff options
author | crupest <crupest@outlook.com> | 2020-07-10 20:18:08 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-07-10 20:18:08 +0800 |
commit | a362066a9a8e64b8c8d58ec5952cb28caa217b35 (patch) | |
tree | 0f28ea177c6e11f419c5edc3f41359a8218f2323 /Timeline | |
parent | 29b3da2aa1f1b4a8514ffea6dc57dda8d8a98170 (diff) | |
download | timeline-a362066a9a8e64b8c8d58ec5952cb28caa217b35.tar.gz timeline-a362066a9a8e64b8c8d58ec5952cb28caa217b35.tar.bz2 timeline-a362066a9a8e64b8c8d58ec5952cb28caa217b35.zip |
Add http api and integrated tests.
Diffstat (limited to 'Timeline')
-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;
|