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
commit3749a642306b19c84f324b0e94c4d62d8ec60332 (patch)
tree9039ebf7eb7a21d2e57bbe928e43bf39a42473b1 /Timeline/Controllers/UserController.cs
parenta7fd42ddee50a8066a083c57b7940e4f9896dcb7 (diff)
downloadtimeline-3749a642306b19c84f324b0e94c4d62d8ec60332.tar.gz
timeline-3749a642306b19c84f324b0e94c4d62d8ec60332.tar.bz2
timeline-3749a642306b19c84f324b0e94c4d62d8ec60332.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)
{