diff options
Diffstat (limited to 'Timeline')
-rw-r--r-- | Timeline/Controllers/TimelineController.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Timeline/Controllers/TimelineController.cs b/Timeline/Controllers/TimelineController.cs index 36e9fe6d..b8cc608b 100644 --- a/Timeline/Controllers/TimelineController.cs +++ b/Timeline/Controllers/TimelineController.cs @@ -102,16 +102,20 @@ namespace Timeline.Controllers }
[HttpGet("timelines/{name}/posts")]
- public async Task<ActionResult<List<TimelinePostInfo>>> PostListGet([FromRoute][GeneralTimelineName] string name)
+ public async Task<ActionResult<List<TimelinePostInfo>>> PostListGet([FromRoute][GeneralTimelineName] string name, [FromQuery] DateTime? modifiedSince)
{
if (!this.IsAdministrator() && !await _service.HasReadPermission(name, this.GetOptionalUserId()))
{
return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
}
- var posts = await _service.GetPosts(name);
- var result = _mapper.Map<List<TimelinePostInfo>>(posts);
+ List<TimelinePost> posts;
+ if (modifiedSince == null)
+ posts = await _service.GetPosts(name);
+ else
+ posts = await _service.GetPosts(name, modifiedSince.Value);
+ var result = _mapper.Map<List<TimelinePostInfo>>(posts);
return result;
}
|