File tree Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 66
77namespace TableBooking . Controllers
88{
9+ using Model . Models ;
10+
911 [ Route ( "[controller]" ) ]
1012 [ ApiController ]
1113 [ Authorize ]
@@ -43,13 +45,12 @@ public async Task<IActionResult> Logout()
4345 throw new NotImplementedException ( ) ;
4446 }
4547
46- // TODO: endpoint user info.
4748 [ HttpGet ]
4849 [ Authorize ]
4950 [ Route ( "{id:guid}" ) ]
50- public async Task < IActionResult > GetUserInfo ( Guid id )
51+ public async Task < AppUserDto > GetUserInfo ( Guid id )
5152 {
52- return await _userService . GetUserInfo ( id ) ;
53+ return await _userService . GetUserInfo ( id , CancellationToken . None ) ;
5354 }
5455 }
5556}
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ namespace TableBooking.Api.Interfaces
1010 public interface IUserService
1111 {
1212 public Task < IActionResult > Register ( UserRegisterDto userRegisterDTO ) ;
13- public Task < IActionResult > Login ( UserLoginDto userLoginDTO , CancellationToken cancellationToken ) ;
14- public Task < AppUser > GetUserInfo ( Guid id ) ;
13+ public Task < IActionResult > Login ( UserLoginDto userLoginDTO ) ;
14+ public Task < AppUserDto > GetUserInfo ( Guid id , CancellationToken cancellationToken ) ;
1515 public Task SeedRoles ( ) ;
1616 }
1717}
Original file line number Diff line number Diff line change @@ -5,4 +5,6 @@ namespace TableBooking.Model.Dtos.UserDtos;
55public class AppUserDto
66{
77 public IEnumerable < Booking > Bookings { get ; set ; }
8+ public string ? Email { get ; set ; } = string . Empty ;
9+ public string ? Username { get ; set ; } = string . Empty ;
810}
Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ public AppUserDto ToDto()
1616 {
1717 return new AppUserDto
1818 {
19- Bookings = Bookings
19+ Bookings = Bookings ,
20+ Email = this . Email ,
21+ Username = this . UserName
2022 } ;
2123 }
2224}
You can’t perform that action at this time.
0 commit comments