- Timestamp:
- 07/10/22 10:27:45 (2 years ago)
- Branches:
- master
- Children:
- a26f6a1
- Parents:
- cc4db18
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
resTools_backend/backend/Controllers/UsersController.cs
rcc4db18 r899b19d 13 13 { 14 14 private readonly IUserService _userService = null; 15 private readonly IRestaurantService _restaurantService = null; 15 16 16 public UsersController(IUserService userService )17 public UsersController(IUserService userService, IRestaurantService restaurantService) 17 18 { 18 19 _userService = userService; 20 _restaurantService = restaurantService; 19 21 } 20 22 … … 45 47 public async Task<AuthenticateResponse> Register(CreateUserRequest req) 46 48 { 47 var response = await _userService.Register(req); 49 bool isFirst = await _restaurantService.GetRestaurant() == null; 50 var response = await _userService.Register(req, isFirst); 51 if (isFirst) 52 { 53 await _restaurantService.CreateRestaurant("", response.Id); 54 } 48 55 return response; 49 56 }
Note:
See TracChangeset
for help on using the changeset viewer.