aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/UserController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-01-31 21:57:09 +0800
committercrupest <crupest@outlook.com>2020-01-31 21:57:09 +0800
commitb892622e7ffdf4220f6631ec58f7a6692881dd35 (patch)
tree9039ebf7eb7a21d2e57bbe928e43bf39a42473b1 /Timeline/Controllers/UserController.cs
parente6d8183f6e5c9dec848fefa007b0e3ab428bbffa (diff)
downloadtimeline-b892622e7ffdf4220f6631ec58f7a6692881dd35.tar.gz
timeline-b892622e7ffdf4220f6631ec58f7a6692881dd35.tar.bz2
timeline-b892622e7ffdf4220f6631ec58f7a6692881dd35.zip
Fix test bugs in user info mapper. Make create user action return created user info.
Diffstat (limited to 'Timeline/Controllers/UserController.cs')
-rw-r--r--Timeline/Controllers/UserController.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Timeline/Controllers/UserController.cs b/Timeline/Controllers/UserController.cs
index 4572296b..26e63f63 100644
--- a/Timeline/Controllers/UserController.cs
+++ b/Timeline/Controllers/UserController.cs
@@ -108,12 +108,12 @@ namespace Timeline.Controllers
}
[HttpPost("userop/createuser"), AdminAuthorize]
- public async Task<ActionResult> CreateUser([FromBody] CreateUserRequest body)
+ public async Task<ActionResult<UserInfo>> CreateUser([FromBody] CreateUserRequest body)
{
try
{
- await _userService.CreateUser(_mapper.Map<User>(body));
- return Ok();
+ var user = await _userService.CreateUser(_mapper.Map<User>(body));
+ return Ok(ConvertToUserInfo(user));
}
catch (ConflictException)
{