diff options
author | crupest <crupest@outlook.com> | 2020-01-31 22:46:17 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-01-31 22:46:17 +0800 |
commit | 873d0d8df10e1d6403b7a4eac1980f874dfe1d05 (patch) | |
tree | f969a960472bbf828e5d639a8deef65341b52a6a /Timeline/Controllers/PersonalTimelineController.cs | |
parent | b892622e7ffdf4220f6631ec58f7a6692881dd35 (diff) | |
download | timeline-873d0d8df10e1d6403b7a4eac1980f874dfe1d05.tar.gz timeline-873d0d8df10e1d6403b7a4eac1980f874dfe1d05.tar.bz2 timeline-873d0d8df10e1d6403b7a4eac1980f874dfe1d05.zip |
Make all patch return the new entity.
Diffstat (limited to 'Timeline/Controllers/PersonalTimelineController.cs')
-rw-r--r-- | Timeline/Controllers/PersonalTimelineController.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Timeline/Controllers/PersonalTimelineController.cs b/Timeline/Controllers/PersonalTimelineController.cs index 27618c41..11353bb5 100644 --- a/Timeline/Controllers/PersonalTimelineController.cs +++ b/Timeline/Controllers/PersonalTimelineController.cs @@ -77,14 +77,15 @@ namespace Timeline.Controllers [HttpPatch("users/{username}/timeline")]
[Authorize]
- public async Task<ActionResult> TimelinePatch([FromRoute][Username] string username, [FromBody] TimelinePatchRequest body)
+ public async Task<ActionResult<BaseTimelineInfo>> 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);
- return Ok();
+ var timeline = await _service.GetTimeline(username);
+ return Ok(timeline);
}
[HttpPut("users/{username}/timeline/members/{member}")]
|