diff options
author | crupest <crupest@outlook.com> | 2020-01-31 21:57:09 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-01-31 21:57:09 +0800 |
commit | 3749a642306b19c84f324b0e94c4d62d8ec60332 (patch) | |
tree | 9039ebf7eb7a21d2e57bbe928e43bf39a42473b1 /Timeline/Controllers/UserController.cs | |
parent | a7fd42ddee50a8066a083c57b7940e4f9896dcb7 (diff) | |
download | timeline-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.cs | 6 |
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)
{
|