aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-02-02 00:31:33 +0800
committercrupest <crupest@outlook.com>2020-02-02 00:31:33 +0800
commite71cb8e368d081747014f1434c5ee157660783f2 (patch)
tree2d161307f76b29c52c60048cf4f65d354a967df3 /Timeline/Controllers
parent673fa5f0645308bfa8d17dc4e0e145bbaf239329 (diff)
downloadtimeline-e71cb8e368d081747014f1434c5ee157660783f2.tar.gz
timeline-e71cb8e368d081747014f1434c5ee157660783f2.tar.bz2
timeline-e71cb8e368d081747014f1434c5ee157660783f2.zip
...
Diffstat (limited to 'Timeline/Controllers')
-rw-r--r--Timeline/Controllers/PersonalTimelineController.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Timeline/Controllers/PersonalTimelineController.cs b/Timeline/Controllers/PersonalTimelineController.cs
index 11353bb5..842da015 100644
--- a/Timeline/Controllers/PersonalTimelineController.cs
+++ b/Timeline/Controllers/PersonalTimelineController.cs
@@ -26,9 +26,9 @@ namespace Timeline.Controllers
}
[HttpGet("users/{username}/timeline")]
- public async Task<ActionResult<BaseTimelineInfo>> TimelineGet([FromRoute][Username] string username)
+ public async Task<ActionResult<TimelineInfo>> TimelineGet([FromRoute][Username] string username)
{
- return await _service.GetTimeline(username);
+ return (await _service.GetTimeline(username)).FillLinks(Url);
}
[HttpGet("users/{username}/timeline/posts")]
@@ -77,14 +77,14 @@ namespace Timeline.Controllers
[HttpPatch("users/{username}/timeline")]
[Authorize]
- public async Task<ActionResult<BaseTimelineInfo>> TimelinePatch([FromRoute][Username] string username, [FromBody] TimelinePatchRequest body)
+ public async Task<ActionResult<TimelineInfo>> TimelinePatch([FromRoute][Username] string username, [FromBody] TimelinePatchRequest body)
{
if (!this.IsAdministrator() && !(User.Identity.Name == username))
{
return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
}
await _service.ChangeProperty(username, body);
- var timeline = await _service.GetTimeline(username);
+ var timeline = (await _service.GetTimeline(username)).FillLinks(Url);
return Ok(timeline);
}